• PySide 模块
  • PySide.QtCore
  • 内容表

    上一话题

    QSizeF

    下一话题

    QMargins

    QSize

    概要

    函数

    详细描述

    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.

    class PySide.QtCore. QSize
    class PySide.QtCore. QSize ( QSize )
    class PySide.QtCore. QSize ( w , h )
    参数:

    Constructs a size with an invalid width and height (i.e., PySide.QtCore.QSize.isValid() returns false).

    构造尺寸,采用给定 width and height .

    PySide.QtCore.QSize. __reduce__ ( )
    返回类型: PyObject
    PySide.QtCore.QSize. __repr__ ( )
    返回类型: PyObject
    PySide.QtCore.QSize. boundedTo ( arg__1 )
    参数: arg__1 PySide.QtCore.QSize
    返回类型: PySide.QtCore.QSize

    返回尺寸,该尺寸保持最小宽度 高度,及给定 otherSize .

    PySide.QtCore.QSize. expandedTo ( arg__1 )
    参数: 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.QSize. height ( )
    返回类型: PySide.QtCore.int

    返回高度。

    PySide.QtCore.QSize. isEmpty ( )
    返回类型: PySide.QtCore.bool

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

    PySide.QtCore.QSize. isNull ( )
    返回类型: PySide.QtCore.bool

    Returns true if both the width and height is 0; otherwise returns false.

    PySide.QtCore.QSize. isValid ( )
    返回类型: PySide.QtCore.bool

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

    PySide.QtCore.QSize. __ne__ ( s2 )
    参数: s2 PySide.QtCore.QSize
    返回类型: PySide.QtCore.bool
    PySide.QtCore.QSize. __mul__ ( c )
    参数: c PySide.QtCore.qreal
    返回类型: PySide.QtCore.QSize
    PySide.QtCore.QSize. __mul__ ( c )
    参数: c PySide.QtCore.qreal
    返回类型: PySide.QtCore.QSize
    PySide.QtCore.QSize. __imul__ ( c )
    参数: 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.

    PySide.QtCore.QSize. __add__ ( s2 )
    参数: s2 PySide.QtCore.QSize
    返回类型: PySide.QtCore.QSize
    PySide.QtCore.QSize. __iadd__ ( arg__1 )
    参数: 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)
    											
    PySide.QtCore.QSize. __sub__ ( s2 )
    参数: s2 PySide.QtCore.QSize
    返回类型: PySide.QtCore.QSize
    PySide.QtCore.QSize. __isub__ ( arg__1 )
    参数: 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)
    											
    PySide.QtCore.QSize. __div__ ( c )
    参数: c PySide.QtCore.qreal
    返回类型: PySide.QtCore.QSize
    PySide.QtCore.QSize. __idiv__ ( c )
    参数: 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.

    另请参阅

    QSize.scale()

    PySide.QtCore.QSize. __eq__ ( s2 )
    参数: s2 PySide.QtCore.QSize
    返回类型: PySide.QtCore.bool
    PySide.QtCore.QSize. scale ( s , mode )
    参数:
    PySide.QtCore.QSize. scale ( w , h , mode )
    参数:
    PySide.QtCore.QSize. setHeight ( h )
    参数: h PySide.QtCore.int

    Sets the height to the given height .

    另请参阅

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

    PySide.QtCore.QSize. setWidth ( w )
    参数: w PySide.QtCore.int

    Sets the width to the given width .

    PySide.QtCore.QSize. toTuple ( )
    返回类型: PyObject
    PySide.QtCore.QSize. transpose ( )

    Swaps the width and height values.

    PySide.QtCore.QSize. width ( )
    返回类型: PySide.QtCore.int

    返回宽度。