PySide6.QtCore.QMargins¶
- class QMargins¶
The
QMarginsclass defines the four margins of a rectangle.Details
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 returnstrueonly if all margins are set to zero.QMargin objects 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
toMarginsF()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__(left, top, right, bottom)
- Parameters:
left – int
top – int
right – int
bottom – int
Constructs margins with the given
left,top,right, andbottomSee also
- bottom()¶
- Return type:
int
Returns the bottom margin.
See also
- isNull()¶
- Return type:
bool
Returns
trueif all margins are is 0; otherwise returns false.- left()¶
- Return type:
int
Returns the left margin.
See also
Returns
trueiflhsandrhsare different; otherwise returnsfalse.- __ne__(rhs)
- Parameters:
rhs –
QMarginsF- Return type:
bool
Returns a
QMarginsobject that is formed by multiplying each component of the givenmarginsbyfactor.See also
operator*=()operator/=()- __mul__(factor)
- Parameters:
factor – int
- Return type:
Returns a
QMarginsobject that is formed by multiplying each component of the givenmarginsbyfactor.See also
operator*=()operator/=()- __mul__(factor)
- Parameters:
factor – float
- Return type:
Returns a
QMarginsobject that is formed by multiplying each component of the givenmarginsbyfactor.See also
operator*=()operator/=()- __mul__(factor)
- Parameters:
factor – float
- Return type:
Returns a
QMarginsobject that is formed by multiplying each component of the givenmarginsbyfactor.See also
operator*=()operator/=()Multiplies each component of this object by
factorand returns a reference to it.See also
operator/=()- __imul__(factor)
- Parameters:
factor – float
- Return type:
Multiplies each component of this object by
factorand returns a reference to it.See also
operator/=()Returns a QMargin object that is formed from all components of
margins.Returns a
QMarginsobject that is the sum of the given margins,m1andm2; each component is added separately.See also
operator+=()operator-=()- __add__(lhs)
- Parameters:
lhs – int
- Return type:
Returns a
QMarginsobject that is formed by addinglhstorhs.See also
operator+=()operator-=()- __add__(rhs)
- Parameters:
rhs – int
- Return type:
Returns a
QMarginsobject that is formed by addingrhstolhs.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 – int
- Return type:
Adds the
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
QMarginsobject that is formed by subtractingm2fromm1; each component is subtracted separately.See also
operator+=()operator-=()- __sub__(rhs)
- Parameters:
rhs – int
- Return type:
Returns a
QMarginsobject that is formed by subtractingrhsfromlhs.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 – int
- Return type:
Subtracts the
subtrahendfrom each component of this object and returns a reference to it.See also
operator+=()Returns a
QMarginsobject that is formed by dividing the components of the givenmarginsby the givendivisor.See also
operator*=()operator/=()- __div__(divisor)
- Parameters:
divisor – float
- Return type:
Returns a
QMarginsobject that is formed by dividing the components of the givenmarginsby the givendivisor.See also
operator*=()operator/=()- operator/=(divisor)
- Parameters:
divisor – int
- Return type:
Divides each component of this object by
divisorand returns a reference to it.See also
operator*=()- operator/=(divisor)
- Parameters:
divisor – float
- Return type:
See also
operator*=()
Returns
trueiflhsandrhsare equal; otherwise returnsfalse.- __eq__(rhs)
- Parameters:
rhs –
QMarginsF- Return type:
bool
Returns a
QMarginsobject that is formed from the maximum of each component ofm2andm1.See also
operator+=()operator-=()- right()¶
- Return type:
int
Returns the right margin.
See also
- setBottom(bottom)¶
- Parameters:
bottom – int
Sets the bottom margin to
bottom.See also
- setLeft(left)¶
- Parameters:
left – int
Sets the left margin to
left.See also
- setRight(right)¶
- Parameters:
right – int
Sets the right margin to
right.See also
- setTop(top)¶
- Parameters:
top – int
Sets the Top margin to
Top.See also
Returns these margins as margins with floating point accuracy.
See also
- top()¶
- Return type:
int
Returns the top margin.
See also