| def __add__ (,s2) |
| def __div__ (,c) |
| def __eq__ (,s2) |
| def __iadd__ (arg__1) |
| def __idiv__ (c) |
| def __imul__ (c) |
| def __isub__ (arg__1) |
| def __mul__ (,c) |
| def __mul__ (c) |
| def __ne__ (,s2) |
| def __sub__ (,s2) |
| def boundedTo (arg__1) |
| def expandedTo (arg__1) |
| def height () |
| def isEmpty () |
| def isNull () |
| def isValid () |
| def scale (s,mode) |
| def scale (w,h,mode) |
| def setHeight (h) |
| def setWidth (w) |
| def transpose () |
| def width () |
The QSize class defines the size of a two-dimensional object using integer point precision.
A size is specified by a QSize.width() and a QSize.height() . It can be set in the constructor and changed using the QSize.setWidth() , QSize.setHeight() , or QSize.scale() functions, or using arithmetic operators. A size can also be manipulated directly by retrieving references to the width and height using the QSize.rwidth() and QSize.rheight() functions. Finally, the width and height can be swapped using the QSize.transpose() function.
The QSize.isValid() function determines if a size is valid (a valid size has both width and height greater than zero). The QSize.isEmpty() function returns true if either of the width and height is less than, or equal to, zero, while the QSize.isNull() function returns true only if both the width and the height is zero.
Use the QSize.expandedTo() function to retrieve a size which holds the maximum height and width of this size and a given size. Similarly, the QSize.boundedTo() function returns a size which holds the minimum height and width of this size and a given size.
QSize objects can be streamed as well as compared.
| Parameters: |
|
|---|
Constructs a size with an invalid width and height (i.e., QSize.isValid() returns false).
See also
Constructs a size with the given width and height .
See also
| Parameter: | arg__1 – QSize |
|---|---|
| Return type: | QSize |
Returns a size holding the minimum width and height of this size and the given otherSize .
See also
| Parameter: | arg__1 – QSize |
|---|---|
| Return type: | QSize |
Returns a size holding the maximum width and height of this size and the given otherSize .
See also
| Return type: | int |
|---|
Returns the height.
See also
| Return type: | bool |
|---|
Returns true if either of the width and height is less than or equal to 0; otherwise returns false.
See also
| Return type: | bool |
|---|
Returns true if both the width and height is 0; otherwise returns false.
See also
| Return type: | bool |
|---|
Returns true if both the width and height is equal to or greater than 0; otherwise returns false.
See also
| Parameter: | s2 – QSize |
|---|---|
| Return type: | bool |
| Parameter: | c – qreal |
|---|---|
| Return type: | QSize |
| Parameter: | c – qreal |
|---|---|
| Return type: | QSize |
| Parameter: | c – qreal |
|---|---|
| Return type: | QSize |
This is an overloaded function.
Multiplies both the width and height by the given factor , and returns a reference to the size.
Note that the result is rounded to the nearest integer.
See also
| Parameter: | s2 – QSize |
|---|---|
| Return type: | QSize |
| Parameter: | arg__1 – QSize |
|---|---|
| Return type: | QSize |
Adds the given size to this size, and returns a reference to this size. For example:
s = QSize( 3, 7)
r = QSize(-1, 4)
s += r
# s becomes (2,11)
| Parameter: | s2 – QSize |
|---|---|
| Return type: | QSize |
| Parameter: | arg__1 – QSize |
|---|---|
| Return type: | QSize |
Subtracts the given size from this size, and returns a reference to this size. For example:
s = QSize( 3, 7)
r = QSize(-1, 4)
s -= r
# s becomes (4,3)
| Parameter: | c – qreal |
|---|---|
| Return type: | QSize |
| Parameter: | c – qreal |
|---|---|
| Return type: | QSize |
This is an overloaded function.
Divides both the width and height by the given divisor , and returns a reference to the size.
Note that the result is rounded to the nearest integer.
See also
| Parameter: | s2 – QSize |
|---|---|
| Return type: | bool |
| Parameters: |
|
|---|
| Parameters: |
|
|---|
| Parameter: | h – int |
|---|
Sets the height to the given height .
See also
QSize.rheight() QSize.height() QSize.setWidth()
| Parameter: | w – int |
|---|
Sets the width to the given width .
See also
QSize.rwidth() QSize.width() QSize.setHeight()
Swaps the width and height values.
See also
| Return type: | int |
|---|
Returns the width.
See also