QtBase
v6.3.1
|
The QMargins class defines the four margins of a rectangle. More...
#include <qmargins.h>
Public Member Functions | |
constexpr | QMargins () noexcept |
constexpr | QMargins (int left, int top, int right, int bottom) noexcept |
constexpr bool | isNull () const noexcept |
constexpr int | left () const noexcept |
constexpr int | top () const noexcept |
constexpr int | right () const noexcept |
constexpr int | bottom () const noexcept |
constexpr void | setLeft (int left) noexcept |
constexpr void | setTop (int top) noexcept |
constexpr void | setRight (int right) noexcept |
constexpr void | setBottom (int bottom) noexcept |
constexpr QMargins & | operator+= (const QMargins &margins) noexcept |
constexpr QMargins & | operator-= (const QMargins &margins) noexcept |
constexpr QMargins & | operator+= (int) noexcept |
constexpr QMargins & | operator-= (int) noexcept |
constexpr QMargins & | operator*= (int) noexcept |
constexpr QMargins & | operator/= (int) |
constexpr QMargins & | operator*= (qreal) noexcept |
constexpr QMargins & | operator/= (qreal) |
Friends | |
constexpr friend bool | operator== (const QMargins &m1, const QMargins &m2) noexcept |
constexpr friend bool | operator!= (const QMargins &m1, const QMargins &m2) noexcept |
Related Functions | |
(Note that these are not member functions.) | |
QMargins | operator+ (const QMargins &m1, const QMargins &m2) |
QMargins | operator- (const QMargins &m1, const QMargins &m2) |
QMargins | operator+ (const QMargins &lhs, int rhs) |
QMargins | operator+ (int lhs, const QMargins &rhs) |
QMargins | operator- (const QMargins &lhs, int rhs) |
QMargins | operator* (const QMargins &margins, int factor) |
QMargins | operator* (int factor, const QMargins &margins) |
QMargins | operator* (const QMargins &margins, qreal factor) |
QMargins | operator* (qreal factor, const QMargins &margins) |
QMargins | operator/ (const QMargins &margins, int divisor) |
QMargins | operator/ (const QMargins &, qreal) |
QMargins | operator+ (const QMargins &margins) |
QMargins | operator- (const QMargins &margins) |
QMargins | operator| (const QMargins &m1, const QMargins &m2) |
QDataStream & | operator<< (QDataStream &stream, const QMargins &m) |
QDataStream & | operator>> (QDataStream &stream, QMargins &m) |
The QMargins class defines the four margins of a rectangle.
\inmodule QtCore
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.
Definition at line 51 of file qmargins.h.
|
inlineconstexprnoexcept |
Constructs a margins object with all margins set to 0.
Definition at line 129 of file qmargins.h.
|
inlineconstexprnoexcept |
Constructs margins with the given left, top, right, and bottom
Definition at line 131 of file qmargins.h.
|
inlineconstexprnoexcept |
Returns the bottom margin.
Definition at line 146 of file qmargins.h.
|
inlineconstexprnoexcept |
Returns true
if all margins are is 0; otherwise returns false.
Definition at line 134 of file qmargins.h.
|
inlineconstexprnoexcept |
Returns the left margin.
Definition at line 137 of file qmargins.h.
|
inlineconstexprnoexcept |
Multiplies each component of this object by factor and returns a reference to it.
Definition at line 262 of file qmargins.h.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Multiplies each component of this object by factor and returns a reference to it.
Definition at line 272 of file qmargins.h.
Add each component of margins to the respective component of this object and returns a reference to it.
Definition at line 234 of file qmargins.h.
|
inlineconstexprnoexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Adds the addend to each component of this object and returns a reference to it.
Definition at line 244 of file qmargins.h.
Subtract each component of margins from the respective component of this object and returns a reference to it.
Definition at line 239 of file qmargins.h.
|
inlineconstexprnoexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Subtracts the subtrahend from each component of this object and returns a reference to it.
Definition at line 253 of file qmargins.h.
|
inlineconstexpr |
Divides each component of this object by divisor and returns a reference to it.
Definition at line 267 of file qmargins.h.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 277 of file qmargins.h.
|
inlineconstexprnoexcept |
Returns the right margin.
Definition at line 143 of file qmargins.h.
|
inlineconstexprnoexcept |
Sets the bottom margin to bottom.
Definition at line 159 of file qmargins.h.
|
inlineconstexprnoexcept |
Sets the left margin to left.
Definition at line 150 of file qmargins.h.
|
inlineconstexprnoexcept |
Sets the right margin to right.
Definition at line 156 of file qmargins.h.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Returns the top margin.
Definition at line 140 of file qmargins.h.
|
friend |
Returns true
if m1 and m2 are different; otherwise returns false
.
Definition at line 93 of file qmargins.h.
Returns a QMargins object that is formed by multiplying each component of the given margins by factor.
Definition at line 192 of file qmargins.h.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns a QMargins object that is formed by multiplying each component of the given margins by factor.
Definition at line 204 of file qmargins.h.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns a QMargins object that is formed by multiplying each component of the given margins by factor.
Definition at line 198 of file qmargins.h.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns a QMargins object that is formed by multiplying each component of the given margins by factor.
Definition at line 210 of file qmargins.h.
Returns a QMargins object that is formed by adding rhs to lhs.
Definition at line 174 of file qmargins.h.
Returns a QMargins object that is the sum of the given margins, m1 and m2; each component is added separately.
Definition at line 162 of file qmargins.h.
Returns a QMargin object that is formed from all components of margins.
Definition at line 282 of file qmargins.h.
Returns a QMargins object that is formed by adding lhs to rhs.
Definition at line 180 of file qmargins.h.
Returns a QMargins object that is formed by subtracting rhs from lhs.
Definition at line 186 of file qmargins.h.
Returns a QMargins object that is formed by subtracting m2 from m1; each component is subtracted separately.
Definition at line 168 of file qmargins.h.
Returns a QMargin object that is formed by negating all components of margins.
Definition at line 287 of file qmargins.h.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns a QMargins object that is formed by dividing the components of the given margins by the given divisor.
Definition at line 222 of file qmargins.h.
Returns a QMargins object that is formed by dividing the components of the given margins by the given divisor.
Definition at line 216 of file qmargins.h.
|
related |
Writes margin m to the given stream and returns a reference to the stream.
Definition at line 423 of file qmargins.cpp.
Returns true
if m1 and m2 are equal; otherwise returns false
.
Definition at line 84 of file qmargins.h.
|
related |
Reads a margin from the given stream into margin m and returns a reference to the stream.
Definition at line 439 of file qmargins.cpp.
Returns a QMargins object that is formed from the maximum of each component of m2 and m1.
Definition at line 228 of file qmargins.h.