CopperSpice API  1.7.2
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 &m)
 
QDataStreamoperator>> (QDataStream &stream, QMargins &m)
 

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.

See also
isNull()

Constructor & Destructor Documentation

QMargins::QMargins ( )
inline

Constructs a margins object with all margins set to 0.

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

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

See also
setLeft(), setRight(), setTop(), setBottom()

Method Documentation

int QMargins::bottom ( ) const
inline

Returns the bottom margin.

See also
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.

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

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

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

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

See also
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.

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

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

See also
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.

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

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

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

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

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

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

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

Returns the right margin.

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

Sets the bottom margin to bottom.

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

Sets the left margin to left.

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

Sets the right margin to right.

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

Sets the Top margin to Top.

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

Returns the top margin.

See also
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.

See also
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.

See also
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.

See also
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.

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

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

See also
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.

See also
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.

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

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

See also
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.

See also
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.

See also
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.

See also
QMargins::operator*=(), QMargins::operator/=()
QDataStream & operator<< ( QDataStream stream,
const QMargins &  m 
)
related

Writes m to the given stream and 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 &  m 
)
related

Reads from the given stream into margin m and returns a reference to the stream.

Refer to Serializing Data Types for additional information.