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

    上一话题

    QLineF

    下一话题

    QPointF

    QLine

    概要

    函数

    详细描述

    PySide.QtCore.QLine class provides a two-dimensional vector using integer precision.

    A PySide.QtCore.QLine describes a finite length line (or a line segment) on a two-dimensional surface. The start and end points of the line are specified using integer point accuracy for coordinates. Use the PySide.QtCore.QLineF constructor to retrieve a floating point copy.

    ../../_images/qline-point.png ../../_images/qline-coordinates.png

    The positions of the line's start and end points can be retrieved using the PySide.QtCore.QLine.p1() , PySide.QtCore.QLine.x1() , PySide.QtCore.QLine.y1() , PySide.QtCore.QLine.p2() , PySide.QtCore.QLine.x2() ,和 PySide.QtCore.QLine.y2() functions. The PySide.QtCore.QLine.dx() and PySide.QtCore.QLine.dy() functions return the horizontal and vertical components of the line. Use PySide.QtCore.QLine.isNull() to determine whether the PySide.QtCore.QLine represents a valid line or a null line.

    Finally, the line can be translated a given offset using the PySide.QtCore.QLine.translate() 函数。

    class PySide.QtCore. QLine
    class PySide.QtCore. QLine ( QLine )
    class PySide.QtCore. QLine ( pt1 , pt2 )
    class PySide.QtCore. QLine ( x1 , y1 , x2 , y2 )
    参数:

    Constructs a null line.

    Constructs a line object that represents the line between p1 and p2 .

    Constructs a line object that represents the line between ( x1 , y1 ) 和 ( x2 , y2 ).

    PySide.QtCore.QLine. __reduce__ ( )
    返回类型: PyObject
    PySide.QtCore.QLine. __repr__ ( )
    返回类型: PyObject
    PySide.QtCore.QLine. dx ( )
    返回类型: PySide.QtCore.int

    Returns the horizontal component of the line's vector.

    PySide.QtCore.QLine. dy ( )
    返回类型: PySide.QtCore.int

    Returns the vertical component of the line's vector.

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

    Returns true if the line is not set up with valid start and end point; otherwise returns false.

    PySide.QtCore.QLine. __ne__ ( d )
    参数: d PySide.QtCore.QLine
    返回类型: PySide.QtCore.bool

    Returns true if the given line is not the same as this line.

    A line is different from another line if any of their start or end points differ, or the internal order of the points is different.

    PySide.QtCore.QLine. __mul__ ( m )
    参数: m PySide.QtGui.QTransform
    返回类型: PySide.QtCore.QLine
    PySide.QtCore.QLine. __mul__ ( m )
    参数: m PySide.QtGui.QMatrix
    返回类型: PySide.QtCore.QLine
    PySide.QtCore.QLine. __eq__ ( d )
    参数: d PySide.QtCore.QLine
    返回类型: PySide.QtCore.bool

    Returns true if the given line 如同 this line.

    A line is identical to another line if the start and end points are identical, and the internal order of the points is the same.

    PySide.QtCore.QLine. p1 ( )
    返回类型: PySide.QtCore.QPoint

    Returns the line's start point.

    PySide.QtCore.QLine. p2 ( )
    返回类型: PySide.QtCore.QPoint

    Returns the line's end point.

    PySide.QtCore.QLine. setLine ( x1 , y1 , x2 , y2 )
    参数:
    • x1 PySide.QtCore.int
    • y1 PySide.QtCore.int
    • x2 PySide.QtCore.int
    • y2 PySide.QtCore.int

    Sets this line to the start in x1 , y1 and end in x2 , y2 .

    PySide.QtCore.QLine. setP1 ( p1 )
    参数: p1 PySide.QtCore.QPoint

    Sets the starting point of this line to p1 .

    PySide.QtCore.QLine. setP2 ( p2 )
    参数: p2 PySide.QtCore.QPoint

    Sets the end point of this line to p2 .

    PySide.QtCore.QLine. setPoints ( p1 , p2 )
    参数:

    Sets the start point of this line to p1 and the end point of this line to p2 .

    PySide.QtCore.QLine. toTuple ( )
    返回类型: PyObject
    PySide.QtCore.QLine. translate ( dx , dy )
    参数:
    • dx PySide.QtCore.int
    • dy PySide.QtCore.int

    这是重载函数。

    Translates this line the distance specified by dx and dy .

    PySide.QtCore.QLine. translate ( p )
    参数: p PySide.QtCore.QPoint

    Translates this line by the given offset .

    PySide.QtCore.QLine. translated ( p )
    参数: p PySide.QtCore.QPoint
    返回类型: PySide.QtCore.QLine

    Returns this line translated by the given offset .

    PySide.QtCore.QLine. translated ( dx , dy )
    参数:
    • dx PySide.QtCore.int
    • dy PySide.QtCore.int
    返回类型:

    PySide.QtCore.QLine

    这是重载函数。

    Returns this line translated the distance specified by dx and dy .

    PySide.QtCore.QLine. x1 ( )
    返回类型: PySide.QtCore.int

    Returns the x-coordinate of the line's start point.

    PySide.QtCore.QLine. x2 ( )
    返回类型: PySide.QtCore.int

    Returns the x-coordinate of the line's end point.

    PySide.QtCore.QLine. y1 ( )
    返回类型: PySide.QtCore.int

    Returns the y-coordinate of the line's start point.

    PySide.QtCore.QLine. y2 ( )
    返回类型: PySide.QtCore.int

    Returns the y-coordinate of the line's end point.