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

    上一话题

    QLine

    下一话题

    QPoint

    QPointF

    概要

    函数

    详细描述

    PySide.QtCore.QPointF class defines a point in the plane using floating point precision.

    A point is specified by a x coordinate and an y coordinate which can be accessed using the PySide.QtCore.QPointF.x() and PySide.QtCore.QPointF.y() functions. The coordinates of the point are specified using floating point numbers for accuracy. The PySide.QtCore.QPointF.isNull() function returns true if both x and y are set to 0.0. The coordinates can be set (or altered) using the PySide.QtCore.QPointF.setX() and PySide.QtCore.QPointF.setY() functions, or alternatively the PySide.QtCore.QPointF.rx() and PySide.QtCore.QPointF.ry() functions which return references to the coordinates (allowing direct manipulation).

    Given a point p , the following statements are all equivalent:

    p = QPointF()
    p.setX(p.x() + 1.0)
    p += QPointF(1.0, 0.0)
    #p.rx()++;
    										

    A PySide.QtCore.QPointF object can also be used as a vector: Addition and subtraction are defined as for vectors (each component is added separately). A PySide.QtCore.QPointF object can also be divided or multiplied by an int qreal .

    此外, PySide.QtCore.QPointF class provides a constructor converting a PySide.QtCore.QPoint object into a PySide.QtCore.QPointF object, and a corresponding PySide.QtCore.QPointF.toPoint() function which returns a PySide.QtCore.QPoint copy of this point. Finally, PySide.QtCore.QPointF objects can be streamed as well as compared.

    class PySide.QtCore. QPointF
    class PySide.QtCore. QPointF ( p )
    class PySide.QtCore. QPointF ( QPointF )
    class PySide.QtCore. QPointF ( xpos , ypos )
    参数:

    构造 null 点,即具有坐标 (0.0, 0.0)

    构造副本为给定 point .

    构造点采用给定坐标 ( x , y ).

    PySide.QtCore.QPointF. __reduce__ ( )
    返回类型: PyObject
    PySide.QtCore.QPointF. __repr__ ( )
    返回类型: PyObject
    PySide.QtCore.QPointF. isNull ( )
    返回类型: PySide.QtCore.bool

    Returns true if both the x and y coordinates are set to +0.0; otherwise returns false.

    注意

    Since this function treats +0.0 and -0.0 differently, points with zero-valued coordinates where either or both values have a negative sign are not defined to be null points.

    PySide.QtCore.QPointF. manhattanLength ( )
    返回类型: PySide.QtCore.qreal

    Returns the sum of the absolute values of PySide.QtCore.QPointF.x() and PySide.QtCore.QPointF.y() , traditionally known as the “Manhattan length” of the vector from the origin to the point.

    PySide.QtCore.QPointF. __ne__ ( p2 )
    参数: p2 PySide.QtCore.QPointF
    返回类型: PySide.QtCore.bool
    PySide.QtCore.QPointF. __mul__ ( c )
    参数: c PySide.QtCore.qreal
    返回类型: PySide.QtCore.QPointF
    PySide.QtCore.QPointF. __mul__ ( c )
    参数: c PySide.QtCore.qreal
    返回类型: PySide.QtCore.QPointF
    PySide.QtCore.QPointF. __mul__ ( m )
    参数: m PySide.QtGui.QTransform
    返回类型: PySide.QtCore.QPointF
    PySide.QtCore.QPointF. __mul__ ( matrix )
    参数: matrix PySide.QtGui.QMatrix4x4
    返回类型: PySide.QtCore.QPointF
    PySide.QtCore.QPointF. __mul__ ( m )
    参数: m PySide.QtGui.QMatrix
    返回类型: PySide.QtCore.QPointF
    PySide.QtCore.QPointF. __mul__ ( matrix )
    参数: matrix PySide.QtGui.QMatrix4x4
    返回类型: PySide.QtCore.QPointF
    PySide.QtCore.QPointF. __imul__ ( c )
    参数: c PySide.QtCore.qreal
    返回类型: PySide.QtCore.QPointF

    Multiplies this point's coordinates by the given factor , and returns a reference to this point. For example:

    p = QPointF(-1.1, 4.1)
    p *= 2.5  # p becomes (-2.75, 10.25)
    											

    另请参阅

    PySide.QtCore.QPointF.operator/=()

    PySide.QtCore.QPointF. __add__ ( p2 )
    参数: p2 PySide.QtCore.QPointF
    返回类型: PySide.QtCore.QPointF
    PySide.QtCore.QPointF. __iadd__ ( p )
    参数: p PySide.QtCore.QPointF
    返回类型: PySide.QtCore.QPointF

    添加给定 point to this point and returns a reference to this point. For example:

    p = QPointF( 3.1, 7.1)
    q = QPointF(-1.0, 4.1)
    p += q    # p becomes (2.1, 11.2)
    											

    另请参阅

    PySide.QtCore.QPointF.operator-=()

    PySide.QtCore.QPointF. __sub__ ( )
    返回类型: PySide.QtCore.QPointF
    PySide.QtCore.QPointF. __sub__ ( p2 )
    参数: p2 PySide.QtCore.QPointF
    返回类型: PySide.QtCore.QPointF
    PySide.QtCore.QPointF. __isub__ ( p )
    参数: p PySide.QtCore.QPointF
    返回类型: PySide.QtCore.QPointF

    Subtracts the given point from this point and returns a reference to this point. For example:

    p = QPointF( 3.1, 7.1)
    q = QPointF(-1.0, 4.1)
    p -= q    # p becomes (4.1, 3.0)
    											

    另请参阅

    PySide.QtCore.QPointF.operator+=()

    PySide.QtCore.QPointF. __div__ ( c )
    参数: c PySide.QtCore.qreal
    返回类型: PySide.QtCore.QPointF
    PySide.QtCore.QPointF. __idiv__ ( c )
    参数: c PySide.QtCore.qreal
    返回类型: PySide.QtCore.QPointF

    Divides both x and y by the given divisor , and returns a reference to this point. For example:

    p = QPointF(-2.75, 10.25)
    p /= 2.5  # p becomes (-1.1, 4.1)
    											

    另请参阅

    PySide.QtCore.QPointF.operator*=()

    PySide.QtCore.QPointF. __eq__ ( p2 )
    参数: p2 PySide.QtCore.QPointF
    返回类型: PySide.QtCore.bool
    PySide.QtCore.QPointF. setX ( x )
    参数: x PySide.QtCore.qreal

    Sets the x coordinate of this point to the given x 坐标。

    PySide.QtCore.QPointF. setY ( y )
    参数: y PySide.QtCore.qreal

    Sets the y coordinate of this point to the given y 坐标。

    PySide.QtCore.QPointF. toPoint ( )
    返回类型: PySide.QtCore.QPoint

    Rounds the coordinates of this point to the nearest integer, and returns a PySide.QtCore.QPoint object with the rounded coordinates.

    另请参阅

    PySide.QtCore.QPointF.QPointF()

    PySide.QtCore.QPointF. toTuple ( )
    返回类型: PyObject
    PySide.QtCore.QPointF. x ( )
    返回类型: PySide.QtCore.qreal

    Returns the x-coordinate of this point.

    另请参阅

    PySide.QtCore.QPointF.setX() PySide.QtCore.QPointF.rx()

    PySide.QtCore.QPointF. y ( )
    返回类型: PySide.QtCore.qreal

    Returns the y-coordinate of this point.

    另请参阅

    PySide.QtCore.QPointF.setY() PySide.QtCore.QPointF.ry()