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

    上一话题

    QRect

    下一话题

    QSize

    QSizeF

    概要

    函数

    详细描述

    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() PySide.QtCore.QSizeF.height() . It can be set in the constructor and changed using the PySide.QtCore.QSizeF.setWidth() , PySide.QtCore.QSizeF.setHeight() ,或 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() 函数。

    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.

    使用 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.

    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 )
    参数:

    Constructs an invalid size.

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

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

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

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

    PySide.QtCore.QSizeF. expandedTo ( arg__1 )
    参数: arg__1 PySide.QtCore.QSizeF
    返回类型: PySide.QtCore.QSizeF

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

    PySide.QtCore.QSizeF. height ( )
    返回类型: PySide.QtCore.qreal

    返回高度。

    PySide.QtCore.QSizeF. 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.QSizeF. isNull ( )
    返回类型: PySide.QtCore.bool

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

    注意

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

    这是重载函数。

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

    PySide.QtCore.QSizeF. __add__ ( s2 )
    参数: s2 PySide.QtCore.QSizeF
    返回类型: PySide.QtCore.QSizeF
    PySide.QtCore.QSizeF. __iadd__ ( arg__1 )
    参数: arg__1 PySide.QtCore.QSizeF
    返回类型: PySide.QtCore.QSizeF

    添加给定 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 )
    参数: s2 PySide.QtCore.QSizeF
    返回类型: PySide.QtCore.QSizeF
    PySide.QtCore.QSizeF. __isub__ ( arg__1 )
    参数: arg__1 PySide.QtCore.QSizeF
    返回类型: 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 )
    参数: c PySide.QtCore.qreal
    返回类型: PySide.QtCore.QSizeF
    PySide.QtCore.QSizeF. __idiv__ ( c )
    参数: c PySide.QtCore.qreal
    返回类型: PySide.QtCore.QSizeF

    这是重载函数。

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

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

    Sets the height to the given height .

    另请参阅

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

    PySide.QtCore.QSizeF. setWidth ( w )
    参数: w PySide.QtCore.qreal

    Sets the width to the given width .

    PySide.QtCore.QSizeF. toSize ( )
    返回类型: 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.

    另请参阅

    PySide.QtCore.QSizeF.QSizeF()

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

    Swaps the width and height values.

    PySide.QtCore.QSizeF. width ( )
    返回类型: PySide.QtCore.qreal

    返回宽度。