The QMarginsF class defines the four margins of a rectangle. 更多...
| 頭: | #include <QMarginsF> |
| CMake: |
find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake: | QT += core |
| QMarginsF () | |
| QMarginsF (qreal left , qreal top , qreal right , qreal bottom ) | |
| QMarginsF (const QMargins & margins ) | |
| qreal | bottom () const |
| bool | isNull () const |
| qreal | left () const |
| qreal | right () const |
| void | setBottom (qreal abottom ) |
| void | setLeft (qreal aleft ) |
| void | setRight (qreal aright ) |
| void | setTop (qreal atop ) |
| QMargins | toMargins () const |
| qreal | top () const |
| QMarginsF & | operator*= (qreal factor ) |
| QMarginsF & | operator+= (const QMarginsF & margins ) |
| QMarginsF & | operator+= (qreal addend ) |
| QMarginsF & | operator-= (const QMarginsF & margins ) |
| QMarginsF & | operator-= (qreal subtrahend ) |
| QMarginsF & | operator/= (qreal divisor ) |
| bool | operator!= (const QMarginsF & lhs , const QMarginsF & rhs ) |
| QMarginsF | operator* (const QMarginsF & lhs , qreal rhs ) |
| QMarginsF | operator* (qreal lhs , const QMarginsF & rhs ) |
| QMarginsF | operator+ (const QMarginsF & lhs , const QMarginsF & rhs ) |
| QMarginsF | operator+ (const QMarginsF & lhs , qreal rhs ) |
| QMarginsF | operator+ (qreal lhs , const QMarginsF & rhs ) |
| QMarginsF | operator+ (const QMarginsF & margins ) |
| QMarginsF | operator- (const QMarginsF & lhs , const QMarginsF & rhs ) |
| QMarginsF | operator- (const QMarginsF & lhs , qreal rhs ) |
| QMarginsF | operator- (const QMarginsF & margins ) |
| QMarginsF | operator/ (const QMarginsF & lhs , qreal rhs ) |
| QDataStream & | operator<< (QDataStream & stream , const QMarginsF & m ) |
| bool | operator== (const QMarginsF & lhs , const QMarginsF & rhs ) |
| QDataStream & | operator>> (QDataStream & stream , QMarginsF & m ) |
| QMarginsF | operator| (const QMarginsF & m1 , const QMarginsF & m2 ) |
QMarginsF defines a set of four margins; left, top, right, and bottom, that describe the finite size of the borders surrounding a rectangle.
The
isNull
() 函數返迴
true
only if all margins are very close to zero.
QMarginsF objects can be streamed as well as compared.
[constexpr]
QMarginsF::
QMarginsF
()
構造邊距對象,采用把所有邊距設為 0。
另請參閱 isNull ().
[constexpr]
QMarginsF::
QMarginsF
(
qreal
left
,
qreal
top
,
qreal
right
,
qreal
bottom
)
構造邊距采用給定 left , top , right ,和 bottom . All parameters must be finite.
另請參閱 setLeft (), setRight (), setTop (),和 setBottom ().
[constexpr]
QMarginsF::
QMarginsF
(const
QMargins
&
margins
)
Constructs margins copied from the given margins .
另請參閱 QMargins::toMarginsF ().
[constexpr]
qreal
QMarginsF::
bottom
() const
返迴下邊距。
另請參閱 setBottom ().
[constexpr]
bool
QMarginsF::
isNull
() const
返迴
true
if all margins are very close to 0; otherwise returns false.
另請參閱 qFuzzyIsNull ().
[constexpr]
qreal
QMarginsF::
left
() const
返迴左邊距。
另請參閱 setLeft ().
[constexpr]
qreal
QMarginsF::
right
() const
返迴右邊距。
另請參閱 setRight ().
[constexpr]
void
QMarginsF::
setBottom
(
qreal
abottom
)
將下邊距設為 abottom (which must be finite).
另請參閱 bottom ().
[constexpr]
void
QMarginsF::
setLeft
(
qreal
aleft
)
將左邊距設為 aleft (which must be finite).
另請參閱 left ().
[constexpr]
void
QMarginsF::
setRight
(
qreal
aright
)
將右邊距設為 aright (which must be finite).
另請參閱 right ().
[constexpr]
void
QMarginsF::
setTop
(
qreal
atop
)
Sets the top margin to atop (which must be finite).
另請參閱 top ().
[constexpr]
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.
另請參閱 QMarginsF () 和 QMargins::toMarginsF ().
[constexpr]
qreal
QMarginsF::
top
() const
返迴上邊距。
另請參閱 setTop ().
[constexpr]
QMarginsF
&QMarginsF::
operator*=
(
qreal
factor
)
Multiplies each component of this object by the given finite factor and returns a reference to this object.
另請參閱 operator/= ().
[constexpr]
QMarginsF
&QMarginsF::
operator+=
(const
QMarginsF
&
margins
)
Add each component of margins to the respective component of this object and returns a reference to it.
另請參閱 operator-= ().
[constexpr]
QMarginsF
&QMarginsF::
operator+=
(
qreal
addend
)
這是重載函數。
Adds the given finite addend to each component of this object and returns a reference to it.
另請參閱 operator-= ().
[constexpr]
QMarginsF
&QMarginsF::
operator-=
(const
QMarginsF
&
margins
)
Subtract each component of margins from the respective component of this object and returns a reference to it.
另請參閱 operator+= ().
[constexpr]
QMarginsF
&QMarginsF::
operator-=
(
qreal
subtrahend
)
這是重載函數。
Subtracts the given finite subtrahend from each component of this object and returns a reference to it.
另請參閱 operator+= ().
[constexpr]
QMarginsF
&QMarginsF::
operator/=
(
qreal
divisor
)
此對象的各分量除以 divisor and returns a reference to this object.
The divisor must not be either zero or NaN.
另請參閱 operator*= ().
[constexpr]
bool
operator!=
(const
QMarginsF
&
lhs
, const
QMarginsF
&
rhs
)
返迴
true
if
lhs
and
rhs
are sufficiently different; otherwise returns
false
.
警告: This function does not check for strict inequality; instead, it uses a fuzzy comparison to compare the margins.
另請參閱 qFuzzyCompare .
[constexpr]
QMarginsF
operator*
(const
QMarginsF
&
lhs
,
qreal
rhs
)
這是重載函數。
返迴 QMarginsF object that is formed by multiplying each component of the given lhs margins by finite factor rhs .
另請參閱 QMarginsF::operator*= () 和 QMarginsF::operator/= ().
[constexpr]
QMarginsF
operator*
(
qreal
lhs
, const
QMarginsF
&
rhs
)
這是重載函數。
返迴 QMarginsF object that is formed by multiplying each component of the given lhs margins by finite factor rhs .
另請參閱 QMarginsF::operator*= () 和 QMarginsF::operator/= ().
[constexpr]
QMarginsF
operator+
(const
QMarginsF
&
lhs
, const
QMarginsF
&
rhs
)
返迴 QMarginsF 對象是和對於給定邊距 lhs and rhs ;各分量分彆相加。
另請參閱 QMarginsF::operator+= () 和 QMarginsF::operator-= ().
[constexpr]
QMarginsF
operator+
(const
QMarginsF
&
lhs
,
qreal
rhs
)
返迴 QMarginsF object that is formed by adding rhs (which must be finite) to each component of lhs .
另請參閱 QMarginsF::operator+= () 和 QMarginsF::operator-= ().
[constexpr]
QMarginsF
operator+
(
qreal
lhs
, const
QMarginsF
&
rhs
)
返迴 QMarginsF object that is formed by adding lhs (which must be finite) to each component of rhs .
另請參閱 QMarginsF::operator+= () 和 QMarginsF::operator-= ().
[constexpr]
QMarginsF
operator+
(const
QMarginsF
&
margins
)
Returns a QMargin object that is formed from all components of margins .
[constexpr]
QMarginsF
operator-
(const
QMarginsF
&
lhs
, const
QMarginsF
&
rhs
)
返迴 QMarginsF 對象的形成是通過減去 rhs from lhs ;分彆減去各分量。
另請參閱 QMarginsF::operator+= () 和 QMarginsF::operator-= ().
[constexpr]
QMarginsF
operator-
(const
QMarginsF
&
lhs
,
qreal
rhs
)
返迴 QMarginsF 對象的形成是通過減去 rhs (which must be finite) from each component of lhs .
另請參閱 QMarginsF::operator+= () 和 QMarginsF::operator-= ().
[constexpr]
QMarginsF
operator-
(const
QMarginsF
&
margins
)
Returns a QMargin object that is formed by negating all components of margins .
[constexpr]
QMarginsF
operator/
(const
QMarginsF
&
lhs
,
qreal
rhs
)
這是重載函數。
返迴 QMarginsF object that is formed by dividing the components of the given lhs margins by the given rhs divisor.
The divisor must not be either zero or NaN.
另請參閱 QMarginsF::operator*= () 和 QMarginsF::operator/= ().
寫入邊距 m 到給定 stream 並返迴流引用。
另請參閱 序列化 Qt 數據類型 .
[constexpr]
bool
operator==
(const
QMarginsF
&
lhs
, const
QMarginsF
&
rhs
)
返迴
true
if
lhs
and
rhs
are approximately equal; otherwise returns false.
警告: This function does not check for strict equality; instead, it uses a fuzzy comparison to compare the margins.
另請參閱 qFuzzyCompare .
讀取邊距從給定 stream 進邊距 m 並返迴流引用。
另請參閱 序列化 Qt 數據類型 .
[constexpr, since 6.0]
QMarginsF
operator|
(const
QMarginsF
&
m1
, const
QMarginsF
&
m2
)
這是重載函數。
返迴 QMarginsF object that is formed from the maximum of each component of m2 and m1 .
該函數在 Qt 6.0 引入。
另請參閱 QMarginsF::operator+= () 和 QMarginsF::operator-= ().