IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QMarginsF Class

The QMarginsF class defines the four margins of a rectangle.

This class was introduced in Qt 5.3.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QMarginsF Class▲

  • Header: QMarginsF

  • Since: Qt 5.3

  • qmake: QT += core

  • Group: QMarginsF is part of painting

Detailed Description▲

QMarginsF defines a set of four margins; left, top, right and bottom, that describe the size of the borders surrounding a rectangle.

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

QMarginsF objects can be streamed as well as compared.

Member Function Documentation▲

 

QMarginsF::QMarginsF()▲

Constructs a margins object with all margins set to 0.

See Also▲

See also isNull()

QMarginsF::QMarginsF(qreal left, qreal top, qreal right, qreal bottom)▲

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

See Also▲

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

QMarginsF::QMarginsF(const QMargins &margins)▲

Constructs margins copied from the given margins

qreal QMarginsF::bottom() const▲

Returns the bottom margin.

See Also▲

See also setBottom()

bool QMarginsF::isNull() const▲

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

qreal QMarginsF::left() const▲

Returns the left margin.

See Also▲

See also setLeft()

qreal QMarginsF::right() const▲

See Also▲

See also setRight()

void QMarginsF::setBottom(qreal bottom)▲

Sets the bottom margin to bottom.

See Also▲

See also bottom()

void QMarginsF::setLeft(qreal left)▲

Sets the left margin to left.

See Also▲

See also left()

void QMarginsF::setRight(qreal right)▲

Sets the right margin to right.

See Also▲

See also right()

void QMarginsF::setTop(qreal Top)▲

Sets the Top margin to Top.

See Also▲

See also top()

QMargins QMarginsF::toMargins() const▲

Returns an integer based copy of this margins object.

Note that the components in the returned margins will be rounded to the nearest integer.

See Also▲

See also QMarginsF()

qreal QMarginsF::top() const▲

Returns the top margin.

See Also▲

See also setTop()

QMarginsF &QMarginsF::operator*=(qreal factor)▲

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

See Also▲

See also operator/=()

QMarginsF &QMarginsF::operator+=(const QMarginsF &margins)▲

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

See Also▲

See also operator-=()

QMarginsF &QMarginsF::operator+=(qreal addend)▲

This is an overloaded function.

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

See Also▲

See also operator-=()

QMarginsF &QMarginsF::operator-=(const QMarginsF &margins)▲

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

See Also▲

See also operator+=()

QMarginsF &QMarginsF::operator-=(qreal subtrahend)▲

This is an overloaded function.

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

See Also▲

See also operator+=()

QMarginsF &QMarginsF::operator/=(qreal divisor)▲

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

See Also▲

See also operator*=()

Related Non-Members▲

 

bool operator!=(const QMarginsF &lhs, const QMarginsF &rhs)▲

Returns true if lhs and rhs are different; otherwise returns false.

QMarginsF operator*(const QMarginsF &lhs, qreal rhs)▲

This is an overloaded function.

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

See Also▲

QMarginsF operator*(qreal lhs, const QMarginsF &rhs)▲

This is an overloaded function.

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

See Also▲

QMarginsF operator+(const QMarginsF &lhs, const QMarginsF &rhs)▲

Returns a QMarginsF object that is the sum of the given margins, lhs and rhs; each component is added separately.

See Also▲

QMarginsF operator+(const QMarginsF &lhs, qreal rhs)▲

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

See Also▲

QMarginsF operator+(qreal lhs, const QMarginsF &rhs)▲

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

See Also▲

QMarginsF operator+(const QMarginsF &margins)▲

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

QMarginsF operator-(const QMarginsF &lhs, const QMarginsF &rhs)▲

Returns a QMarginsF object that is formed by subtracting rhs from lhs; each component is subtracted separately.

See Also▲

QMarginsF operator-(const QMarginsF &lhs, qreal rhs)▲

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

See Also▲

QMarginsF operator-(const QMarginsF &margins)▲

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

QMarginsF operator/(const QMarginsF &lhs, qreal rhs)▲

This is an overloaded function.

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

See Also▲

QDataStream &operator<<(QDataStream &stream, const QMarginsF &m)▲

Writes margin m to the given stream and returns a reference to the stream.

See Also▲

bool operator==(const QMarginsF &lhs, const QMarginsF &rhs)▲

Returns true if lhs and rhs are equal; otherwise returns false.

QDataStream &operator>>(QDataStream &stream, QMarginsF &m)▲

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

See Also▲

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+