CopperSpice API  1.7.4
QMarginsF Class Reference

The QMarginsF class 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 factor)
 
QMarginsF & operator+= (const QMarginsF &other)
 
QMarginsF & operator+= (qreal delta)
 
QMarginsF & operator-= (const QMarginsF &other)
 
QMarginsF & operator-= (qreal delta)
 
QMarginsF & operator/= (qreal factor)
 
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 &m1, const QMarginsF &m2)
 
QMarginsF operator+ (const QMarginsF &margins)
 
QMarginsF operator+ (const QMarginsF &margins, int delta)
 
QMarginsF operator+ (int delta, const QMarginsF &margins)
 
QMarginsF operator- (const QMarginsF &m1, const QMarginsF &m2)
 
QMarginsF operator- (const QMarginsF &margins)
 
QMarginsF operator- (const QMarginsF &margins, int delta)
 
QMarginsF operator/ (const QMarginsF &margins, int factor)
 
QMarginsF operator/ (const QMarginsF &margins, qreal factor)
 
QDataStreamoperator<< (QDataStream &stream, const QMarginsF &margins)
 
bool operator== (const QMarginsF &m1, const QMarginsF &m2)
 
QDataStreamoperator>> (QDataStream &stream, QMarginsF &margins)
 

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.

Constructor & Destructor Documentation

QMarginsF::QMarginsF ( )
inline

Constructs a margins object with all margins set to 0.

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

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

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

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

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

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

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

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

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

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

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

Divides each component of this object by factor 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 a QMargins value based on 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 created by multiplying each component of margins by the given factor.

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

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

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

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

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

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

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

Returns a QMarginsF object created by adding 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 copy of the given margins.

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

Returns a QMarginsF object created by adding margins to the given delta.

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

Returns a QMarginsF object created by adding the given delta to margins.

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

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

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

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

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

Returns a QMarginsF object created by subtracting the given delta from margins.

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

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

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

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

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

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

QDataStream & operator>> ( QDataStream stream,
QMarginsF &  margins 
)
related

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

Refer to Serializing Data Types for additional information.