QMarginsF#

The QMarginsF class defines the four margins of a rectangle. More

Synopsis#

Functions#

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

Detailed Description#

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() function returns true only if all margins are very close to zero.

QMarginsF objects can be streamed as well as compared.

class PySide6.QtCore.QMarginsF#

PySide6.QtCore.QMarginsF(margins)

PySide6.QtCore.QMarginsF(left, top, right, bottom)

Parameters:

Constructs a margins object with all margins set to 0.

See also

isNull()

Constructs margins copied from the given margins.

See also

toMarginsF()

Constructs margins with the given left, top, right, and bottom. All parameters must be finite.

PySide6.QtCore.QMarginsF.bottom()#
Return type:

float

Returns the bottom margin.

See also

setBottom()

PySide6.QtCore.QMarginsF.isNull()#
Return type:

bool

Returns true if all margins are very close to 0; otherwise returns false.

See also

qFuzzyIsNull()

PySide6.QtCore.QMarginsF.left()#
Return type:

float

Returns the left margin.

See also

setLeft()

PySide6.QtCore.QMarginsF.__ne__(rhs)#
Parameters:

rhsPySide6.QtCore.QMarginsF

Return type:

bool

Returns true if lhs and rhs are sufficiently different; otherwise returns false.

Warning

This function does not check for strict inequality; instead, it uses a fuzzy comparison to compare the margins.

See also

qFuzzyCompare

PySide6.QtCore.QMarginsF.__mul__(lhs)#
Parameters:

lhs – float

Return type:

PySide6.QtCore.QMarginsF

This is an overloaded function.

Returns a QMarginsF object that is formed by multiplying each component of the given lhs margins by finite factor rhs.

See also

operator*=() operator/=()

PySide6.QtCore.QMarginsF.__mul__(rhs)
Parameters:

rhs – float

Return type:

PySide6.QtCore.QMarginsF

This is an overloaded function.

Returns a QMarginsF object that is formed by multiplying each component of the given lhs margins by finite factor rhs.

See also

operator*=() operator/=()

PySide6.QtCore.QMarginsF.__imul__(factor)#
Parameters:

factor – float

Return type:

PySide6.QtCore.QMarginsF

Multiplies each component of this object by the given finite factor and returns a reference to this object.

See also

operator/=()

PySide6.QtCore.QMarginsF.__add__()#
Return type:

PySide6.QtCore.QMarginsF

Returns a QMargin object that is formed from all components of margins.

PySide6.QtCore.QMarginsF.__add__(rhs)
Parameters:

rhsPySide6.QtCore.QMarginsF

Return type:

PySide6.QtCore.QMarginsF

Returns a QMarginsF object that is the sum of the given margins, lhs and rhs; each component is added separately.

See also

operator+=() operator-=()

PySide6.QtCore.QMarginsF.__add__(lhs)
Parameters:

lhs – float

Return type:

PySide6.QtCore.QMarginsF

Returns a QMarginsF object that is formed by adding lhs (which must be finite) to each component of rhs.

See also

operator+=() operator-=()

PySide6.QtCore.QMarginsF.__add__(rhs)
Parameters:

rhs – float

Return type:

PySide6.QtCore.QMarginsF

Returns a QMarginsF object that is formed by adding rhs (which must be finite) to each component of lhs.

See also

operator+=() operator-=()

PySide6.QtCore.QMarginsF.__iadd__(margins)#
Parameters:

marginsPySide6.QtCore.QMarginsF

Return type:

PySide6.QtCore.QMarginsF

Add each component of margins to the respective component of this object and returns a reference to it.

See also

operator-=()

PySide6.QtCore.QMarginsF.__iadd__(addend)
Parameters:

addend – float

Return type:

PySide6.QtCore.QMarginsF

This is an overloaded function.

Adds the given finite addend to each component of this object and returns a reference to it.

See also

operator-=()

PySide6.QtCore.QMarginsF.__sub__(rhs)#
Parameters:

rhsPySide6.QtCore.QMarginsF

Return type:

PySide6.QtCore.QMarginsF

Returns a QMarginsF object that is formed by subtracting rhs from lhs; each component is subtracted separately.

See also

operator+=() operator-=()

PySide6.QtCore.QMarginsF.__sub__(rhs)
Parameters:

rhs – float

Return type:

PySide6.QtCore.QMarginsF

Returns a QMarginsF object that is formed by subtracting rhs (which must be finite) from each component of lhs.

See also

operator+=() operator-=()

PySide6.QtCore.QMarginsF.__sub__()
Return type:

PySide6.QtCore.QMarginsF

Returns a QMargin object that is formed by negating all components of margins.

PySide6.QtCore.QMarginsF.__isub__(margins)#
Parameters:

marginsPySide6.QtCore.QMarginsF

Return type:

PySide6.QtCore.QMarginsF

Subtract each component of margins from the respective component of this object and returns a reference to it.

See also

operator+=()

PySide6.QtCore.QMarginsF.__isub__(subtrahend)
Parameters:

subtrahend – float

Return type:

PySide6.QtCore.QMarginsF

This is an overloaded function.

Subtracts the given finite subtrahend from each component of this object and returns a reference to it.

See also

operator+=()

PySide6.QtCore.QMarginsF.__div__(divisor)#
Parameters:

divisor – float

Return type:

PySide6.QtCore.QMarginsF

This is an overloaded function.

Returns a 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.

See also

operator*=() operator/=()

PySide6.QtCore.QMarginsF.operator/=(divisor)
Parameters:

divisor – float

Return type:

PySide6.QtCore.QMarginsF

Divides each component of this object by divisor and returns a reference to this object.

The divisor must not be either zero or NaN.

See also

operator*=()

PySide6.QtCore.QMarginsF.__eq__(rhs)#
Parameters:

rhsPySide6.QtCore.QMarginsF

Return type:

bool

Returns true if lhs and rhs are 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

qFuzzyCompare

PySide6.QtCore.QMarginsF.__or__(m2)#
Parameters:

m2PySide6.QtCore.QMarginsF

Return type:

PySide6.QtCore.QMarginsF

This is an overloaded function.

Returns a QMarginsF object that is formed from the maximum of each component of m2 and m1.

See also

operator+=() operator-=()

PySide6.QtCore.QMarginsF.right()#
Return type:

float

Returns the right margin.

See also

setRight()

PySide6.QtCore.QMarginsF.setBottom(abottom)#
Parameters:

abottom – float

Sets the bottom margin to abottom (which must be finite).

See also

bottom()

PySide6.QtCore.QMarginsF.setLeft(aleft)#
Parameters:

aleft – float

Sets the left margin to aleft (which must be finite).

See also

left()

PySide6.QtCore.QMarginsF.setRight(aright)#
Parameters:

aright – float

Sets the right margin to aright (which must be finite).

See also

right()

PySide6.QtCore.QMarginsF.setTop(atop)#
Parameters:

atop – float

Sets the top margin to atop (which must be finite).

See also

top()

PySide6.QtCore.QMarginsF.toMargins()#
Return type:

PySide6.QtCore.QMargins

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()

PySide6.QtCore.QMarginsF.top()#
Return type:

float

Returns the top margin.

See also

setTop()