CopperSpice API  1.9.2
QMargins Class Reference

The QMargins class 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 factor)
 
QMargins & operator*= (qreal factor)
 
QMargins & operator+= (const QMargins &other)
 
QMargins & operator+= (int delta)
 
QMargins & operator-= (const QMargins &other)
 
QMargins & operator-= (int delta)
 
QMargins & operator/= (int factor)
 
QMargins & operator/= (qreal factor)
 
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 &m1, const QMargins &m2)
 
bool operator== (const QMargins &m1, const QMargins &m2)
 

Related Functions

These are not member functions

QMargins operator* (const QMargins &margins, int factor)
 
QMargins operator* (const QMargins &margins, qreal factor)
 
QMargins operator* (int factor, const QMargins &margins)
 
QMargins operator* (qreal factor, const QMargins &margins)
 
QMargins operator+ (const QMargins &m1, const QMargins &m2)
 
QMargins operator+ (const QMargins &margins)
 
QMargins operator+ (const QMargins &margins, int delta)
 
QMargins operator+ (int delta, const QMargins &margins)
 
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, int factor)
 
QMargins operator/ (const QMargins &margins, qreal factor)
 
QDataStreamoperator<< (QDataStream &stream, const QMargins &margins)
 
QDataStreamoperator>> (QDataStream &stream, QMargins &margins)
 

Detailed Description

The QMargins class defines the four margins of a rectangle. This class 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.

Constructor & Destructor Documentation

QMargins::QMargins ( )
inline

Constructs a margins object with all margins set to 0.

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  factor)
inline

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

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

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

See also
operator/=()
QMargins & QMargins::operator+= ( const QMargins &  other)
inline

Add each component of other 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 &  other)
inline

Subtract each component of other 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  factor)
inline

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

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

Divides each component of this object by factor 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  factor 
)
related

Returns a QMargins object created by multiplying each component of margins by the given factor.

See also
QMargins::operator*=(), QMargins::operator/=()
QMargins operator* ( const QMargins &  margins,
qreal  factor 
)
related

Returns a QMargins object created by multiplying each component of margins by the given factor.

See also
QMargins::operator*=(), QMargins::operator/=()
QMargins operator* ( int  factor,
const QMargins &  margins 
)
related

Returns a QMargins object created by multiplying each component of margins by the given factor.

See also
QMargins::operator*=(), QMargins::operator/=()
QMargins operator* ( qreal  factor,
const QMargins &  margins 
)
related

Returns a QMargins object created by multiplying each component of margins by the given factor.

See also
QMargins::operator*=(), QMargins::operator/=()
QMargins operator+ ( const QMargins &  m1,
const QMargins &  m2 
)
related

Returns a QMargins object which 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 copy of margins.

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

Returns a QMargins object created by adding margins to delta.

See also
QMargins::operator+=(), QMargins::operator-=()
QMargins operator+ ( int  delta,
const QMargins &  margins 
)
related

Returns a QMargins object created by adding delta to margins.

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

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

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

Returns a QMargins object created by negating all components of margins.

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

Returns a QMargins object created by subtracting delta from margins.

See also
QMargins::operator+=(), QMargins::operator-=()
QMargins operator/ ( const QMargins &  margins,
int  factor 
)
related

Returns a QMargins object created by dividing the components of the margins by the given factor.

See also
QMargins::operator*=(), QMargins::operator/=()
QMargins operator/ ( const QMargins &  margins,
qreal  factor 
)
related

Returns a QMargins object created by dividing the components of the margins by the given factor.

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

Writes the given margins 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 &  margins 
)
related

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

Refer to Serializing Data Types for additional information.