PySide6.QtCore.QMarginsF¶
- class QMarginsF¶
The
QMarginsFclass defines the four margins of a rectangle.Details
QMarginsFdefines a set of four margins; left, top, right, and bottom, that describe the finite size of the borders surrounding a rectangle.The
isNull()function returnstrueonly if all margins are very close to zero.QMarginsFobjects can be streamed as well as compared.Synopsis¶
Methods¶
def
__init__()def
bottom()def
isNull()def
left()def
__ne__()def
__mul__()def
__imul__()def
__add__()def
__iadd__()def
__sub__()def
__isub__()def
__div__()def
operator/=()def
__eq__()def
__or__()def
right()def
setBottom()def
setLeft()def
setRight()def
setTop()def
toMargins()def
top()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
- __init__()¶
Constructs a margins object with all margins set to 0.
See also
- __init__(margins)
- Parameters:
margins –
QMargins
Constructs margins copied from the given
margins.See also
- __init__(left, top, right, bottom)
- Parameters:
left – float
top – float
right – float
bottom – float
Constructs margins with the given
left,top,right, andbottom. All parameters must be finite.See also
- bottom()¶
- Return type:
float
Returns the bottom margin.
See also
- isNull()¶
- Return type:
bool
Returns
trueif all margins are very close to 0; otherwise returns false.See also
qFuzzyIsNull()- left()¶
- Return type:
float
Returns the left margin.
See also
- __ne__(rhs)
- Parameters:
rhs –
QMarginsF- Return type:
bool
Returns
trueiflhsandrhsare sufficiently different; otherwise returnsfalse.Warning
This function does not check for strict inequality; instead, it uses a fuzzy comparison to compare the margins.
See also
qFuzzyCompareReturns a
QMarginsFobject that is formed by multiplying each component of the givenlhsmargins by finite factorrhs.See also
operator*=()operator/=()- __mul__(rhs)
- Parameters:
rhs – float
- Return type:
Returns a
QMarginsFobject that is formed by multiplying each component of the givenlhsmargins by finite factorrhs.See also
operator*=()operator/=()Multiplies each component of this object by the given finite
factorand returns a reference to this object.See also
operator/=()Returns a QMargin object that is formed from all components of
margins.Returns a
QMarginsFobject that is the sum of the given margins,lhsandrhs; each component is added separately.See also
operator+=()operator-=()- __add__(lhs)
- Parameters:
lhs – float
- Return type:
Returns a
QMarginsFobject that is formed by addinglhs(which must be finite) to each component ofrhs.See also
operator+=()operator-=()- __add__(rhs)
- Parameters:
rhs – float
- Return type:
Returns a
QMarginsFobject that is formed by addingrhs(which must be finite) to each component oflhs.See also
operator+=()operator-=()Add each component of
marginsto the respective component of this object and returns a reference to it.See also
operator-=()- __iadd__(addend)
- Parameters:
addend – float
- Return type:
Adds the given finite
addendto each component of this object and returns a reference to it.See also
operator-=()Returns a QMargin object that is formed by negating all components of
margins.Returns a
QMarginsFobject that is formed by subtractingrhsfromlhs; each component is subtracted separately.See also
operator+=()operator-=()- __sub__(rhs)
- Parameters:
rhs – float
- Return type:
Returns a
QMarginsFobject that is formed by subtractingrhs(which must be finite) from each component oflhs.See also
operator+=()operator-=()Subtract each component of
marginsfrom the respective component of this object and returns a reference to it.See also
operator+=()- __isub__(subtrahend)
- Parameters:
subtrahend – float
- Return type:
Subtracts the given finite
subtrahendfrom each component of this object and returns a reference to it.See also
operator+=()Returns a
QMarginsFobject that is formed by dividing the components of the givenlhsmargins by the givenrhsdivisor.The divisor must not be either zero or NaN.
See also
operator*=()operator/=()- operator/=(divisor)
- Parameters:
divisor – float
- Return type:
Divides each component of this object by
divisorand returns a reference to this object.The
divisormust not be either zero or NaN.See also
operator*=()- __eq__(rhs)
- Parameters:
rhs –
QMarginsF- Return type:
bool
Returns
trueiflhsandrhsare approximately equal; otherwise returns false.Warning
This function does not check for strict equality; instead, it uses a fuzzy comparison to compare the margins.
See also
qFuzzyCompareReturns a
QMarginsFobject that is formed from the maximum of each component ofm2andm1.See also
operator+=()operator-=()- right()¶
- Return type:
float
Returns the right margin.
See also
- setBottom(abottom)¶
- Parameters:
abottom – float
Sets the bottom margin to
abottom(which must be finite).See also
- setLeft(aleft)¶
- Parameters:
aleft – float
Sets the left margin to
aleft(which must be finite).See also
- setRight(aright)¶
- Parameters:
aright – float
Sets the right margin to
aright(which must be finite).See also
- setTop(atop)¶
- Parameters:
atop – float
Sets the top margin to
atop(which must be finite).See also
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
QMarginsF()toMarginsF()- top()¶
- Return type:
float
Returns the top margin.
See also