BPS C++ API  2.24.4
BpsMargins Class Reference

This class is used to store margins top, right, bottom and left. More...

#include <bpsmargins.h>

Public Member Functions

qreal bottom () const
 
 BpsMargins ()
 The default constructor creates an invalid margins object (all values = -1.0).
 
 BpsMargins (const BpsMargins &aMargins)
 The copy constructor. More...
 
 BpsMargins (qreal aTop, qreal aRight, qreal aBottom, qreal aLeft)
 Convenience constructor where the margin values are provided. More...
 
 BpsMargins (qreal aTopBottom, qreal aLeftRight)
 Convenience constructor where the margin values are provided. More...
 
 BpsMargins (qreal aValue)
 Convenience constructor where the margin values are provided. More...
 
bool isNull () const
 
bool isValid () const
 
qreal left () const
 
 operator QVariant () const
 
BpsMarginsoperator*= (qreal aFactor)
 Multiply all margin values by a factor. More...
 
BpsMarginsoperator/= (qreal aDivisor)
 Divide all margin values by a divisor. More...
 
qreal & rbottom ()
 
qreal right () const
 
qreal & rleft ()
 
qreal & rright ()
 
qreal & rtop ()
 
void setBottom (qreal aValue)
 Set the bottom margin value. More...
 
void setLeft (qreal aValue)
 Set the left margin value. More...
 
void setRight (qreal aValue)
 Set the right margin value. More...
 
void setTop (qreal aValue)
 Set the top margin value. More...
 
qreal top () const
 
QString toString () const
 

Static Public Member Functions

static int metaType ()
 

Related Functions

(Note that these are not member functions.)

bool operator!= (const BpsMargins &aFirst, const BpsMargins &aSecond)
 Compare two margin objects. More...
 
const BpsMargins operator* (const BpsMargins &aMargins, qreal aFactor)
 Multiply a margin object by a qreal. More...
 
const BpsMargins operator* (qreal aFactor, const BpsMargins &aMargins)
 Multiply a qreal with a margin object. More...
 
const BpsMargins operator/ (const BpsMargins &aMargins, qreal aDivisor)
 Divide a margin object by a qreal. More...
 
bool operator== (const BpsMargins &aFirst, const BpsMargins &aSecond)
 Compare two margin objects. More...
 

Detailed Description

This class is used to store margins top, right, bottom and left.

Constructor & Destructor Documentation

◆ BpsMargins() [1/4]

BpsMargins::BpsMargins ( const BpsMargins aMargins)

The copy constructor.

Parameters
aMarginsThe original margins to clone.

◆ BpsMargins() [2/4]

BpsMargins::BpsMargins ( qreal  aValue)

Convenience constructor where the margin values are provided.

Parameters
aValueThe default for all 4 margins.

◆ BpsMargins() [3/4]

BpsMargins::BpsMargins ( qreal  aTopBottom,
qreal  aLeftRight 
)

Convenience constructor where the margin values are provided.

Parameters
aTopBottomThe top and bottom margin values.
aLeftRightThe left and right margin values.

◆ BpsMargins() [4/4]

BpsMargins::BpsMargins ( qreal  aTop,
qreal  aRight,
qreal  aBottom,
qreal  aLeft 
)

Convenience constructor where the margin values are provided.

Parameters
aTopThe top margin value.
aRightThe right margin value.
aBottomThe bottom margin value.
aLeftThe left margin value.

Member Function Documentation

◆ bottom()

qreal BpsMargins::bottom ( ) const
inline
Returns
The bottom margin value.

◆ isNull()

bool BpsMargins::isNull ( ) const
inline
Returns
True when all margins are = 0.0

◆ isValid()

bool BpsMargins::isValid ( ) const
inline
Returns
True when all margins are >= 0.0

◆ left()

qreal BpsMargins::left ( ) const
inline
Returns
The left margin value.

◆ metaType()

static int BpsMargins::metaType ( )
static
Returns
Get the Qt META type registered for BpsMargins.

◆ operator QVariant()

BpsMargins::operator QVariant ( ) const
inline
Returns
The margins as QVariant.

◆ operator*=()

BpsMargins & BpsMargins::operator*= ( qreal  aFactor)
inline

Multiply all margin values by a factor.

Parameters
aFactorThe factor to multiply by.
Returns
Reference of the margins object.

◆ operator/=()

BpsMargins & BpsMargins::operator/= ( qreal  aDivisor)
inline

Divide all margin values by a divisor.

Parameters
aDivisorThe value to divide by.
Returns
Reference of the margins object.

◆ rbottom()

qreal & BpsMargins::rbottom ( )
inline
Returns
The bottom margin value as reference.

◆ right()

qreal BpsMargins::right ( ) const
inline
Returns
The right margin value.

◆ rleft()

qreal & BpsMargins::rleft ( )
inline
Returns
The left margin value as reference.

◆ rright()

qreal & BpsMargins::rright ( )
inline
Returns
The right margin value as reference.

◆ rtop()

qreal & BpsMargins::rtop ( )
inline
Returns
The top margin value as reference.

◆ setBottom()

void BpsMargins::setBottom ( qreal  aValue)
inline

Set the bottom margin value.

Parameters
aValueThe new value to set.

◆ setLeft()

void BpsMargins::setLeft ( qreal  aValue)
inline

Set the left margin value.

Parameters
aValueThe new value to set.

◆ setRight()

void BpsMargins::setRight ( qreal  aValue)
inline

Set the right margin value.

Parameters
aValueThe new value to set.

◆ setTop()

void BpsMargins::setTop ( qreal  aValue)
inline

Set the top margin value.

Parameters
aValueThe new value to set.

◆ top()

qreal BpsMargins::top ( ) const
inline
Returns
The top margin value.

◆ toString()

QString BpsMargins::toString ( ) const
Returns
String representation of the value as "BpsMargins(top, right, bottom, left)".

Friends And Related Function Documentation

◆ operator!=()

bool operator!= ( const BpsMargins aFirst,
const BpsMargins aSecond 
)
related

Compare two margin objects.

Parameters
aFirstThe first object.
aSecondThe second object.
Returns
True if both are not equal.

◆ operator*() [1/2]

const BpsMargins operator* ( const BpsMargins aMargins,
qreal  aFactor 
)
related

Multiply a margin object by a qreal.

Parameters
aMarginsThe margin object.
aFactorThe multiply factor.
Returns
New margin object with the result.

◆ operator*() [2/2]

const BpsMargins operator* ( qreal  aFactor,
const BpsMargins aMargins 
)
related

Multiply a qreal with a margin object.

Parameters
aFactorThe multiply factor.
aMarginsThe margin object.
Returns
New margin object with the result.

◆ operator/()

const BpsMargins operator/ ( const BpsMargins aMargins,
qreal  aDivisor 
)
related

Divide a margin object by a qreal.

Parameters
aMarginsThe margin object.
aDivisorThe divisor.
Returns
New margin object with the result.

◆ operator==()

bool operator== ( const BpsMargins aFirst,
const BpsMargins aSecond 
)
related

Compare two margin objects.

Parameters
aFirstThe first object.
aSecondThe second object.
Returns
True if both are equal.

The documentation for this class was generated from the following file: