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.
Parameters: |
|
---|
Constructs an invalid size.
See also
Constructs a size with floating point accuracy from the given size .
See also
Constructs a size with the given width and height .
Return type: | PyObject |
---|
Return type: | PyObject |
---|
Parameters: | arg__1 – PySide.QtCore.QSizeF |
---|---|
Return type: | PySide.QtCore.QSizeF |
Returns a size holding the minimum width and height of this size and the given otherSize .
Parameters: | arg__1 – PySide.QtCore.QSizeF |
---|---|
Return type: | PySide.QtCore.QSizeF |
Returns a size holding the maximum width and height of this size and the given otherSize .
Return type: | PySide.QtCore.qreal |
---|
Returns the height.
Return type: | PySide.QtCore.bool |
---|
Returns true if either of the width and height is less than or equal to 0; otherwise returns false.
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.
Return type: | PySide.QtCore.bool |
---|
Returns true if both the width and height is equal to or greater than 0; otherwise returns false.
Parameters: | s2 – PySide.QtCore.QSizeF |
---|---|
Return type: | PySide.QtCore.bool |
Parameters: | c – PySide.QtCore.qreal |
---|---|
Return type: | PySide.QtCore.QSizeF |
Parameters: | c – PySide.QtCore.qreal |
---|---|
Return type: | PySide.QtCore.QSizeF |
Parameters: | c – PySide.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.
See also
Parameters: | s2 – PySide.QtCore.QSizeF |
---|---|
Return type: | PySide.QtCore.QSizeF |
Parameters: | arg__1 – PySide.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)
Parameters: | s2 – PySide.QtCore.QSizeF |
---|---|
Return type: | PySide.QtCore.QSizeF |
Parameters: | arg__1 – PySide.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)
Parameters: | c – PySide.QtCore.qreal |
---|---|
Return type: | PySide.QtCore.QSizeF |
Parameters: | c – PySide.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.
See also
Parameters: | s2 – PySide.QtCore.QSizeF |
---|---|
Return type: | PySide.QtCore.bool |
Parameters: |
|
---|
Parameters: |
---|
Parameters: | h – PySide.QtCore.qreal |
---|
Sets the height to the given height .
See also
PySide.QtCore.QSizeF.height() PySide.QtCore.QSizeF.rheight() PySide.QtCore.QSizeF.setWidth()
Parameters: | w – PySide.QtCore.qreal |
---|
Sets the width to the given width .
See also
PySide.QtCore.QSizeF.width() PySide.QtCore.QSizeF.rwidth() PySide.QtCore.QSizeF.setHeight()
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()
Return type: | PyObject |
---|
Swaps the width and height values.
Return type: | PySide.QtCore.qreal |
---|
Returns the width.