 CopperSpice API  1.7.4
QMargins Class Reference

Defines the four margins of a rectangle. More...

## Public Methods

QMargins ()

QMargins (int left, int top, int right, int bottom)

int bottom () const

bool isNull () const

int left () const

QMargins & operator*= (int delta)

QMargins & operator*= (qreal delta)

QMargins & operator+= (const QMargins &margins)

QMargins & operator+= (int delta)

QMargins & operator-= (const QMargins &margins)

QMargins & operator-= (int delta)

QMargins & operator/= (int delta)

QMargins & operator/= (qreal delta)

int right () const

void setBottom (int bottom)

void setLeft (int left)

void setRight (int right)

void setTop (int top)

int top () const

## Friends

bool operator!= (const QMargins &, const QMargins &)

bool operator== (const QMargins &, const QMargins &)

## Related Functions

These are not member functions

QMargins operator* (const QMargins &margins, int delta)

QMargins operator* (const QMargins &margins, qreal delta)

QMargins operator* (int delta, const QMargins &margins)

QMargins operator* (qreal delta, const QMargins &margins)

QMargins operator+ (const QMargins &lhs, int rhs)

QMargins operator+ (const QMargins &m1, const QMargins &m2)

QMargins operator+ (const QMargins &margins)

QMargins operator+ (int lhs, const QMargins &rhs)

QMargins operator- (const QMargins &lhs, int rhs)

QMargins operator- (const QMargins &m1, const QMargins &m2)

QMargins operator- (const QMargins &margins)

QMargins operator/ (const QMargins &margins, int delta)

QMargins operator/ (const QMargins &margins, qreal delta)

QDataStreamoperator<< (QDataStream &stream, const QMargins &margin)

QDataStreamoperator>> (QDataStream &stream, QMargins &margin)

## Detailed Description

The QMargins class defines the four margins of a rectangle. QMargin defines a set of four margins; left, top, right and bottom, that describe the size of the borders surrounding a rectangle.

The isNull() method returns true only if all margins are set to zero.

QMargin objects can be streamed as well as compared.

isNull()

## Constructor & Destructor Documentation

 QMargins::QMargins ( )
inline

Constructs a margins object with all margins set to 0.

isNull()
 QMargins::QMargins ( int left, int top, int right, int bottom )
inline

Constructs margins with the given left, top, right, and bottom.

setLeft(), setRight(), setTop(), setBottom()

## Method Documentation

 int QMargins::bottom ( ) const
inline

Returns the bottom margin.

setBottom()
 bool QMargins::isNull ( ) const
inline

Returns true if all margins are 0, otherwise returns false.

 int QMargins::left ( ) const
inline

Returns the left margin.

setLeft()
 QMargins & QMargins::operator*= ( int delta )
inline

Multiplies each component of this object by delta and returns a reference to it.

operator/=()
 QMargins & QMargins::operator*= ( qreal delta )
inline

Multiplies each component of this object by delta and returns a reference to it.

operator/=()
 QMargins & QMargins::operator+= ( const QMargins & margins )
inline

Add each component of margins to the respective component of this object and returns a reference to it.

operator-=()
 QMargins & QMargins::operator+= ( int delta )
inline

Adds the delta component to each component of this object and returns a reference to it.

operator-=()
 QMargins & QMargins::operator-= ( const QMargins & margins )
inline

Subtract each component of margins from the respective component of this object and returns a reference to it.

operator+=()
 QMargins & QMargins::operator-= ( int delta )
inline

Subtracts the delta from each component of this object and returns a reference to it.

operator+=()
 QMargins & QMargins::operator/= ( int delta )
inline

Divides each component of this object by delta and returns a reference to it.

operator*=()
 QMargins & QMargins::operator/= ( qreal delta )
inline

Divides each component of this object by delta and returns a reference to it.

operator*=()
 int QMargins::right ( ) const
inline

Returns the right margin.

setRight()
 void QMargins::setBottom ( int bottom )
inline

Sets the bottom margin to bottom.

bottom()
 void QMargins::setLeft ( int left )
inline

Sets the left margin to left.

left()
 void QMargins::setRight ( int right )
inline

Sets the right margin to right.

right()
 void QMargins::setTop ( int top )
inline

Sets the Top margin to Top.

top()
 int QMargins::top ( ) const
inline

Returns the top margin.

setTop()

## Friends And Related Function Documentation

 bool operator!= ( const QMargins & m1, const QMargins & m2 )
friend

Returns true if m1 and m2 are different, otherwise returns false.

 QMargins operator* ( const QMargins & margins, int delta )
related

Returns a QMargins object that is formed by multiplying each component of the given margins by delta.

QMargins::operator*=(), QMargins::operator/=()
 QMargins operator* ( const QMargins & margins, qreal delta )
related

Returns a QMargins object that is formed by multiplying each component of the given margins by delta.

QMargins::operator*=(), QMargins::operator/=()
 QMargins operator* ( int delta, const QMargins & margins )
related

Returns a QMargins object that is formed by multiplying each component of the given margins by delta.

QMargins::operator*=(), QMargins::operator/=()
 QMargins operator* ( qreal delta, const QMargins & margins )
related

Returns a QMargins object that is formed by multiplying each component of the given margins by delta.

QMargins::operator*=(), QMargins::operator/=()
 QMargins operator+ ( const QMargins & lhs, int rhs )
related

Returns a QMargins object that is formed by adding rhs to lhs.

QMargins::operator+=(), QMargins::operator-=()
 QMargins operator+ ( const QMargins & m1, const QMargins & m2 )
related

Returns a QMargins object that is the sum of the given margins, m1 and m2. Each component is added separately.

QMargins::operator+=(), QMargins::operator-=()
 QMargins operator+ ( const QMargins & margins )
related

Returns a QMargin object that is formed from all components of margins.

 QMargins operator+ ( int lhs, const QMargins & rhs )
related

Returns a QMargins object that is formed by adding lhs to rhs.

QMargins::operator+=(), QMargins::operator-=()
 QMargins operator- ( const QMargins & lhs, int rhs )
related

Returns a QMargins object that is formed by subtracting rhs from lhs.

QMargins::operator+=(), QMargins::operator-=()
 QMargins operator- ( const QMargins & m1, const QMargins & m2 )
related

Returns a QMargins object that is formed by subtracting m2 from m1. Each component is subtracted separately.

QMargins::operator+=(), QMargins::operator-=()
 QMargins operator- ( const QMargins & margins )
related

Returns a QMargin object that is formed by negating all components of margins.

 QMargins operator/ ( const QMargins & margins, int delta )
related

Returns a QMargins object that is formed by dividing the components of the given margins by the given delta.

QMargins::operator*=(), QMargins::operator/=()
 QMargins operator/ ( const QMargins & margins, qreal delta )
related

Returns a QMargins object that is formed by dividing the components of the given margins by the given delta.

QMargins::operator*=(), QMargins::operator/=()
 QDataStream & operator<< ( QDataStream & stream, const QMargins & margin )
related

Writes the given margin to the stream. Returns a reference to the stream.

Refer to Serializing Data Types for additional information.

 bool operator== ( const QMargins & m1, const QMargins & m2 )
friend

Returns true if m1 and m2 are equal, otherwise returns false.

 QDataStream & operator>> ( QDataStream & stream, QMargins & margin )
related

Reads from the stream into the given margin. Returns a reference to the stream.

Refer to Serializing Data Types for additional information.