QMargins Class▲
-
Header: QMargins
-
CMake:
find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
-
qmake: QT += core
-
Inherited By:
-
Group: QMargins is part of painting
Detailed Description▲
QMargin 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.
QMargin objects can be streamed as well as compared.
Member Function Documentation▲
[constexpr] QMargins::QMargins()▲
[constexpr] QMargins::QMargins(int left, int top, int right, int bottom)▲
Constructs margins with the given left, top, right, and bottom
See Also▲
[constexpr] int QMargins::bottom() const▲
[constexpr] bool QMargins::isNull() const▲
Returns true if all margins are is 0; otherwise returns false.
[constexpr] int QMargins::left() const▲
[constexpr] int QMargins::right() const▲
[constexpr] void QMargins::setBottom(int bottom)▲
[constexpr] void QMargins::setLeft(int left)▲
[constexpr] void QMargins::setRight(int right)▲
[constexpr] void QMargins::setTop(int Top)▲
[constexpr, since 6.4] QMarginsF QMargins::toMarginsF() const▲
Returns these margins as margins with floating point accuracy.
This function was introduced in Qt 6.4.
See Also▲
See also QMarginsF::toMargins()
[constexpr] int QMargins::top() const▲
[constexpr, since 5.1] QMargins &QMargins::operator*=(int factor)▲
Multiplies each component of this object by factor and returns a reference to it.
This function was introduced in Qt 5.1.
See Also▲
See also operator/=()
[constexpr, since 5.1] QMargins &QMargins::operator*=(qreal factor)▲
This is an overloaded function.
Multiplies each component of this object by factor and returns a reference to it.
This function was introduced in Qt 5.1.
See Also▲
See also operator/=()
[constexpr, since 5.1] QMargins &QMargins::operator+=(const QMargins &margins)▲
Add each component of margins to the respective component of this object and returns a reference to it.
This function was introduced in Qt 5.1.
See Also▲
See also operator-=()
[constexpr] QMargins &QMargins::operator+=(int 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-=()
[constexpr, since 5.1] QMargins &QMargins::operator-=(const QMargins &margins)▲
Subtract each component of margins from the respective component of this object and returns a reference to it.
This function was introduced in Qt 5.1.
See Also▲
See also operator+=()
[constexpr] QMargins &QMargins::operator-=(int 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+=()
[constexpr, since 5.1] QMargins &QMargins::operator/=(int divisor)▲
Divides each component of this object by divisor and returns a reference to it.
This function was introduced in Qt 5.1.
See Also▲
See also operator*=()
[constexpr, since 5.1] QMargins &QMargins::operator/=(qreal divisor)▲
This is an overloaded function.
This function was introduced in Qt 5.1.
See Also▲
See also operator*=()
Related Non-Members▲
[constexpr] bool operator!=(const QMargins &m1, const QMargins &m2)▲
Returns true if m1 and m2 are different; otherwise returns false.
[constexpr, since 5.1] QMargins operator*(const QMargins &margins, int factor)▲
Returns a QMargins object that is formed by multiplying each component of the given margins by factor.
This function was introduced in Qt 5.1.
See Also▲
See also QMargins::operator*=(), QMargins::operator/=()
[constexpr, since 5.1] QMargins operator*(int factor, const QMargins &margins)▲
This is an overloaded function.
Returns a QMargins object that is formed by multiplying each component of the given margins by factor.
This function was introduced in Qt 5.1.
See Also▲
See also QMargins::operator*=(), QMargins::operator/=()
[constexpr, since 5.1] QMargins operator*(const QMargins &margins, qreal factor)▲
This is an overloaded function.
Returns a QMargins object that is formed by multiplying each component of the given margins by factor.
This function was introduced in Qt 5.1.
See Also▲
See also QMargins::operator*=(), QMargins::operator/=()
[constexpr, since 5.1] QMargins operator*(qreal factor, const QMargins &margins)▲
This is an overloaded function.
Returns a QMargins object that is formed by multiplying each component of the given margins by factor.
This function was introduced in Qt 5.1.
See Also▲
See also QMargins::operator*=(), QMargins::operator/=()
[constexpr, since 5.1] QMargins operator+(const QMargins &m1, const QMargins &m2)▲
Returns a QMargins object that is the sum of the given margins, m1 and m2; each component is added separately.
This function was introduced in Qt 5.1.
See Also▲
See also QMargins::operator+=(), QMargins::operator-=()
[constexpr, since 5.3] QMargins operator+(const QMargins &lhs, int rhs)▲
Returns a QMargins object that is formed by adding rhs to lhs.
This function was introduced in Qt 5.3.
See Also▲
See also QMargins::operator+=(), QMargins::operator-=()
[constexpr, since 5.3] QMargins operator+(int lhs, const QMargins &rhs)▲
Returns a QMargins object that is formed by adding lhs to rhs.
This function was introduced in Qt 5.3.
See Also▲
See also QMargins::operator+=(), QMargins::operator-=()
[constexpr, since 5.3] QMargins operator+(const QMargins &margins)▲
Returns a QMargin object that is formed from all components of margins.
This function was introduced in Qt 5.3.
[constexpr, since 5.1] QMargins operator-(const QMargins &m1, const QMargins &m2)▲
Returns a QMargins object that is formed by subtracting m2 from m1; each component is subtracted separately.
This function was introduced in Qt 5.1.
See Also▲
See also QMargins::operator+=(), QMargins::operator-=()
[constexpr, since 5.3] QMargins operator-(const QMargins &lhs, int rhs)▲
Returns a QMargins object that is formed by subtracting rhs from lhs.
This function was introduced in Qt 5.3.
See Also▲
See also QMargins::operator+=(), QMargins::operator-=()
[constexpr, since 5.1] QMargins operator-(const QMargins &margins)▲
Returns a QMargin object that is formed by negating all components of margins.
This function was introduced in Qt 5.1.
[constexpr, since 5.1] QMargins operator/(const QMargins &margins, int divisor)▲
Returns a QMargins object that is formed by dividing the components of the given margins by the given divisor.
This function was introduced in Qt 5.1.
See Also▲
See also QMargins::operator*=(), QMargins::operator/=()
[constexpr, since 5.1] QMargins operator/(const QMargins &margins, qreal divisor)▲
This is an overloaded function.
Returns a QMargins object that is formed by dividing the components of the given margins by the given divisor.
This function was introduced in Qt 5.1.
See Also▲
See also QMargins::operator*=(), QMargins::operator/=()
QDataStream &operator<<(QDataStream &stream, const QMargins &m)▲
Writes margin m to the given stream and returns a reference to the stream.
See Also▲
See also Serializing Qt Data Types
[constexpr] bool operator==(const QMargins &m1, const QMargins &m2)▲
Returns true if m1 and m2 are equal; otherwise returns false.
QDataStream &operator>>(QDataStream &stream, QMargins &m)▲
Reads a margin from the given stream into margin m and returns a reference to the stream.
See Also▲
See also Serializing Qt Data Types
[constexpr, since 6.0] QMargins operator|(const QMargins &m1, const QMargins &m2)▲
Returns a QMargins object that is formed from the maximum of each component of m2 and m1.
This function was introduced in Qt 6.0.
See Also▲
See also QMargins::operator+=(), QMargins::operator-=()