PySide.QtCore.QSize class defines the size of a two-dimensional object using integer point precision.
A size is specified by a PySide.QtCore.QSize.width() 和 PySide.QtCore.QSize.height() . It can be set in the constructor and changed using the PySide.QtCore.QSize.setWidth() , PySide.QtCore.QSize.setHeight() ,或 PySide.QtCore.QSize.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.QSize.rwidth() and PySide.QtCore.QSize.rheight() functions. Finally, the width and height can be swapped using the PySide.QtCore.QSize.transpose() 函数。
PySide.QtCore.QSize.isValid() function determines if a size is valid (a valid size has both width and height greater than zero). The PySide.QtCore.QSize.isEmpty() function returns true if either of the width and height is less than, or equal to, zero, while the PySide.QtCore.QSize.isNull() function returns true only if both the width and the height is zero.
使用 PySide.QtCore.QSize.expandedTo() function to retrieve a size which holds the maximum height and width of this size and a given size. Similarly, the PySide.QtCore.QSize.boundedTo() function returns a size which holds the minimum height and width of this size and a given size.
PySide.QtCore.QSize objects can be streamed as well as compared.
| 参数: |
|
|---|
Constructs a size with an invalid width and height (i.e., PySide.QtCore.QSize.isValid() returns false).
构造尺寸,采用给定 width and height .
| 返回类型: | PyObject |
|---|
| 返回类型: | PyObject |
|---|
| 参数: | arg__1 – PySide.QtCore.QSize |
|---|---|
| 返回类型: | PySide.QtCore.QSize |
返回尺寸,该尺寸保持最小宽度 高度,及给定 otherSize .
| 参数: | arg__1 – PySide.QtCore.QSize |
|---|---|
| 返回类型: | PySide.QtCore.QSize |
Returns a size holding the maximum width and height of this size and the given otherSize .
| 返回类型: | PySide.QtCore.int |
|---|
返回高度。
| 返回类型: | PySide.QtCore.bool |
|---|
Returns true if either of the width and height is less than or equal to 0; otherwise returns false.
| 返回类型: | PySide.QtCore.bool |
|---|
Returns true if both the width and height is 0; otherwise returns false.
| 返回类型: | PySide.QtCore.bool |
|---|
Returns true if both the width and height is equal to or greater than 0; otherwise returns false.
| 参数: | s2 – PySide.QtCore.QSize |
|---|---|
| 返回类型: | PySide.QtCore.bool |
| 参数: | c – PySide.QtCore.qreal |
|---|---|
| 返回类型: | PySide.QtCore.QSize |
| 参数: | c – PySide.QtCore.qreal |
|---|---|
| 返回类型: | PySide.QtCore.QSize |
| 参数: | c – PySide.QtCore.qreal |
|---|---|
| 返回类型: | PySide.QtCore.QSize |
这是重载函数。
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.
| 参数: | s2 – PySide.QtCore.QSize |
|---|---|
| 返回类型: | PySide.QtCore.QSize |
| 参数: | arg__1 – PySide.QtCore.QSize |
|---|---|
| 返回类型: | PySide.QtCore.QSize |
添加给定 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)
| 参数: | s2 – PySide.QtCore.QSize |
|---|---|
| 返回类型: | PySide.QtCore.QSize |
| 参数: | arg__1 – PySide.QtCore.QSize |
|---|---|
| 返回类型: | PySide.QtCore.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)
| 参数: | c – PySide.QtCore.qreal |
|---|---|
| 返回类型: | PySide.QtCore.QSize |
| 参数: | c – PySide.QtCore.qreal |
|---|---|
| 返回类型: | PySide.QtCore.QSize |
这是重载函数。
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.
另请参阅
| 参数: | s2 – PySide.QtCore.QSize |
|---|---|
| 返回类型: | PySide.QtCore.bool |
| 参数: |
|---|
| 参数: |
|
|---|
| 参数: | h – PySide.QtCore.int |
|---|
Sets the height to the given height .
另请参阅
PySide.QtCore.QSize.rheight() PySide.QtCore.QSize.height() PySide.QtCore.QSize.setWidth()
| 参数: | w – PySide.QtCore.int |
|---|
Sets the width to the given width .
另请参阅
PySide.QtCore.QSize.rwidth() PySide.QtCore.QSize.width() PySide.QtCore.QSize.setHeight()
| 返回类型: | PyObject |
|---|
Swaps the width and height values.
| 返回类型: | PySide.QtCore.int |
|---|
返回宽度。