Table Of Contents

Previous topic

QRect

Next topic

QSize

QSizeF

Synopsis

Functions

Detailed Description

The PySide.QtCore.QSizeF class defines the size of a two-dimensional object using floating point precision.

A size is specified by a PySide.QtCore.QSizeF.width() and a PySide.QtCore.QSizeF.height() . It can be set in the constructor and changed using the PySide.QtCore.QSizeF.setWidth() , PySide.QtCore.QSizeF.setHeight() , or PySide.QtCore.QSizeF.scale() functions, or using arithmetic operators. A size can also be manipulated directly by retrieving references to the width and height using the PySide.QtCore.QSizeF.rwidth() and PySide.QtCore.QSizeF.rheight() functions. Finally, the width and height can be swapped using the PySide.QtCore.QSizeF.transpose() function.

The PySide.QtCore.QSizeF.isValid() function determines if a size is valid. A valid size has both width and height greater than or equal to zero. The PySide.QtCore.QSizeF.isEmpty() function returns true if either of the width and height is less than (or equal to) zero, while the PySide.QtCore.QSizeF.isNull() function returns true only if both the width and the height is zero.

Use the PySide.QtCore.QSizeF.expandedTo() function to retrieve a size which holds the maximum height and width of this size and a given size. Similarly, the PySide.QtCore.QSizeF.boundedTo() function returns a size which holds the minimum height and width of this size and a given size.

The PySide.QtCore.QSizeF class also provides the PySide.QtCore.QSizeF.toSize() function returning a PySide.QtCore.QSize copy of this size, constructed by rounding the width and height to the nearest integers.

PySide.QtCore.QSizeF objects can be streamed as well as compared.

class PySide.QtCore.QSizeF
class PySide.QtCore.QSizeF(sz)
class PySide.QtCore.QSizeF(QSizeF)
class PySide.QtCore.QSizeF(w, h)
Parameters:

Constructs an invalid size.

Constructs a size with floating point accuracy from the given size .

Constructs a size with the given width and height .

PySide.QtCore.QSizeF.__reduce__()
Return type:PyObject
PySide.QtCore.QSizeF.__repr__()
Return type:PyObject
PySide.QtCore.QSizeF.boundedTo(arg__1)
Parameters:arg__1PySide.QtCore.QSizeF
Return type:PySide.QtCore.QSizeF

Returns a size holding the minimum width and height of this size and the given otherSize .

PySide.QtCore.QSizeF.expandedTo(arg__1)
Parameters:arg__1PySide.QtCore.QSizeF
Return type:PySide.QtCore.QSizeF

Returns a size holding the maximum width and height of this size and the given otherSize .

PySide.QtCore.QSizeF.height()
Return type:PySide.QtCore.qreal

Returns the height.

PySide.QtCore.QSizeF.isEmpty()
Return type:PySide.QtCore.bool

Returns true if either of the width and height is less than or equal to 0; otherwise returns false.

PySide.QtCore.QSizeF.isNull()
Return type:PySide.QtCore.bool

Returns true if both the width and height are +0.0; otherwise returns false.

Note

Since this function treats +0.0 and -0.0 differently, sizes with zero width and height where either or both values have a negative sign are not defined to be null sizes.

PySide.QtCore.QSizeF.isValid()
Return type:PySide.QtCore.bool

Returns true if both the width and height is equal to or greater than 0; otherwise returns false.

PySide.QtCore.QSizeF.__ne__(s2)
Parameters:s2PySide.QtCore.QSizeF
Return type:PySide.QtCore.bool
PySide.QtCore.QSizeF.__mul__(c)
Parameters:cPySide.QtCore.qreal
Return type:PySide.QtCore.QSizeF
PySide.QtCore.QSizeF.__mul__(c)
Parameters:cPySide.QtCore.qreal
Return type:PySide.QtCore.QSizeF
PySide.QtCore.QSizeF.__imul__(c)
Parameters:cPySide.QtCore.qreal
Return type:PySide.QtCore.QSizeF

This is an overloaded function.

Multiplies both the width and height by the given factor and returns a reference to the size.

PySide.QtCore.QSizeF.__add__(s2)
Parameters:s2PySide.QtCore.QSizeF
Return type:PySide.QtCore.QSizeF
PySide.QtCore.QSizeF.__iadd__(arg__1)
Parameters:arg__1PySide.QtCore.QSizeF
Return type:PySide.QtCore.QSizeF

Adds the given size to this size and returns a reference to this size. For example:

s = QSizeF( 3, 7)
r = QSizeF(-1, 4)
s += r

# s becomes (2,11)
PySide.QtCore.QSizeF.__sub__(s2)
Parameters:s2PySide.QtCore.QSizeF
Return type:PySide.QtCore.QSizeF
PySide.QtCore.QSizeF.__isub__(arg__1)
Parameters:arg__1PySide.QtCore.QSizeF
Return type:PySide.QtCore.QSizeF

Subtracts the given size from this size and returns a reference to this size. For example:

s = QSizeF( 3, 7)
r = QSizeF(-1, 4)
s -= r

# s becomes (4,3)
PySide.QtCore.QSizeF.__div__(c)
Parameters:cPySide.QtCore.qreal
Return type:PySide.QtCore.QSizeF
PySide.QtCore.QSizeF.__idiv__(c)
Parameters:cPySide.QtCore.qreal
Return type:PySide.QtCore.QSizeF

This is an overloaded function.

Divides both the width and height by the given divisor and returns a reference to the size.

PySide.QtCore.QSizeF.__eq__(s2)
Parameters:s2PySide.QtCore.QSizeF
Return type:PySide.QtCore.bool
PySide.QtCore.QSizeF.scale(w, h, mode)
Parameters:
PySide.QtCore.QSizeF.scale(s, mode)
Parameters:
PySide.QtCore.QSizeF.setHeight(h)
Parameters:hPySide.QtCore.qreal

Sets the height to the given height .

See also

PySide.QtCore.QSizeF.height() PySide.QtCore.QSizeF.rheight() PySide.QtCore.QSizeF.setWidth()

PySide.QtCore.QSizeF.setWidth(w)
Parameters:wPySide.QtCore.qreal

Sets the width to the given width .

See also

PySide.QtCore.QSizeF.width() PySide.QtCore.QSizeF.rwidth() PySide.QtCore.QSizeF.setHeight()

PySide.QtCore.QSizeF.toSize()
Return type:PySide.QtCore.QSize

Returns an integer based copy of this size.

Note that the coordinates in the returned size will be rounded to the nearest integer.

See also

PySide.QtCore.QSizeF.QSizeF()

PySide.QtCore.QSizeF.toTuple()
Return type:PyObject
PySide.QtCore.QSizeF.transpose()

Swaps the width and height values.

PySide.QtCore.QSizeF.width()
Return type:PySide.QtCore.qreal

Returns the width.