CopperSpice API  1.7.2
QMarginsF Class Reference

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

Public Methods

 QMarginsF ()
 
 QMarginsF (const QMargins &margins)
 
 QMarginsF (qreal left, qreal top, qreal right, qreal bottom)
 
qreal bottom () const
 
bool isNull () const
 
qreal left () const
 
QMarginsF & operator*= (qreal delta)
 
QMarginsF & operator+= (const QMarginsF &margins)
 
QMarginsF & operator+= (qreal delta)
 
QMarginsF & operator-= (const QMarginsF &margins)
 
QMarginsF & operator-= (qreal delta)
 
QMarginsF & operator/= (qreal delta)
 
qreal right () const
 
void setBottom (qreal bottom)
 
void setLeft (qreal left)
 
void setRight (qreal right)
 
void setTop (qreal top)
 
QMargins toMargins () const
 
qreal top () const
 

Related Functions

These are not member functions

bool operator!= (const QMarginsF &m1, const QMarginsF &m2)
 
QMarginsF operator* (const QMarginsF &margins, int factor)
 
QMarginsF operator* (const QMarginsF &margins, qreal factor)
 
QMarginsF operator* (int factor, const QMarginsF &margins)
 
QMarginsF operator* (qreal factor, const QMarginsF &margins)
 
QMarginsF operator+ (const QMarginsF &lhs, int rhs)
 
QMarginsF operator+ (const QMarginsF &m1, const QMarginsF &m2)
 
QMarginsF operator+ (const QMarginsF &margins)
 
QMarginsF operator+ (int lhs, const QMarginsF &rhs)
 
QMarginsF operator- (const QMarginsF &lhs, int rhs)
 
QMarginsF operator- (const QMarginsF &m1, const QMarginsF &m2)
 
QMarginsF operator- (const QMarginsF &margins)
 
QMarginsF operator/ (const QMarginsF &margins, int divisor)
 
QMarginsF operator/ (const QMarginsF &margins, qreal divisor)
 
QDataStreamoperator<< (QDataStream &stream, const QMarginsF &m)
 
bool operator== (const QMarginsF &m1, const QMarginsF &m2)
 
QDataStreamoperator>> (QDataStream &stream, QMarginsF &m)
 

Detailed Description

The QMarginsF class defines the four margins of a rectangle. QMarginsF defines a set of four margins: left, top, right and bottom which describes the size of the borders surrounding a rectangle.

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

QMarginsF objects can be streamed as well as compared.

Constructor & Destructor Documentation

QMarginsF::QMarginsF ( )
inline

Constructs a margins object with all margins set to 0.

See also
isNull()
QMarginsF::QMarginsF ( qreal  left,
qreal  top,
qreal  right,
qreal  bottom 
)
inline

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

See also
setLeft(), setRight(), setTop(), setBottom()
QMarginsF::QMarginsF ( const QMargins margins)
inline

Copy constructs a new QMarginsF from margins.

Method Documentation

qreal QMarginsF::bottom ( ) const
inline

Returns the bottom margin.

See also
setBottom()
bool QMarginsF::isNull ( ) const
inline

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

qreal QMarginsF::left ( ) const
inline

Returns the left margin.

See also
setLeft()
QMarginsF & QMarginsF::operator*= ( qreal  delta)
inline

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

See also
operator/=()
QMarginsF & QMarginsF::operator+= ( const QMarginsF &  margins)
inline

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

See also
operator-=()
QMarginsF & QMarginsF::operator+= ( qreal  delta)
inline

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

See also
operator-=()
QMarginsF & QMarginsF::operator-= ( const QMarginsF &  margins)
inline

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

See also
operator+=()
QMarginsF & QMarginsF::operator-= ( qreal  delta)
inline

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

See also
operator+=()
QMarginsF & QMarginsF::operator/= ( qreal  delta)
inline

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

See also
operator*=()
qreal QMarginsF::right ( ) const
inline

Returns the right margin.

See also
setRight()
void QMarginsF::setBottom ( qreal  bottom)
inline

Sets the bottom margin to bottom.

See also
bottom()
void QMarginsF::setLeft ( qreal  left)
inline

Sets the left margin to left.

See also
left()
void QMarginsF::setRight ( qreal  right)
inline

Sets the right margin to right.

See also
right()
void QMarginsF::setTop ( qreal  top)
inline

Sets the top margin to top.

See also
top()
QMargins QMarginsF::toMargins ( ) const
inline

Returns an integer based coy of this object.

qreal QMarginsF::top ( ) const
inline

Returns the top margin.

See also
setTop()

Friends And Related Function Documentation

bool operator!= ( const QMarginsF &  m1,
const QMarginsF &  m2 
)
related

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

QMarginsF operator* ( const QMarginsF &  margins,
int  factor 
)
related

Returns a QMarginsF object that is formed by multiplying each component of the given margins by factor.

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

Returns a QMarginsF object that is formed by multiplying each component of the given margins by factor.

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

Returns a QMarginsF object that is formed by multiplying each component of the given margins by factor.

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

Returns a QMarginsF object that is formed by multiplying each component of the given margins by factor.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

QMarginsF operator/ ( const QMarginsF &  margins,
int  divisor 
)
related

Returns a QMarginsF object that is formed by dividing the components of the given margins by the given divisor.

See also
QMarginsF::operator*=(), QMarginsF::operator/=()
QMarginsF operator/ ( const QMarginsF &  margins,
qreal  divisor 
)
related

Returns a QMarginsF object that is formed by dividing the components of the given margins by the given divisor.

See also
QMarginsF::operator*=(), QMarginsF::operator/=()
QDataStream & operator<< ( QDataStream stream,
const QMarginsF &  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 QMarginsF &  m1,
const QMarginsF &  m2 
)
related

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

QDataStream & operator>> ( QDataStream stream,
QMarginsF &  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.