内容表

上一话题

QLibraryInfo

下一话题

QLineF

QLine

QLine class provides a two-dimensional vector using integer precision. 更多

Inheritance diagram of PySide2.QtCore.QLine

概要

函数

详细描述

A 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 QLineF constructor to retrieve a floating point copy.

qline-point1

qline-coordinates2

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

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

class QLine

QLine(QLine)

QLine(pt1, pt2)

QLine(x1, y1, x2, y2)

param QLine

QLine

param y1

int

param y2

int

param pt1

QPoint

param x1

int

param pt2

QPoint

param x2

int

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 ).

PySide2.QtCore.QLine. __reduce__ ( )
返回类型

PyObject

PySide2.QtCore.QLine. __repr__ ( )
返回类型

PyObject

PySide2.QtCore.QLine. center ( )
返回类型

QPoint

Returns the center point of this line. This is equivalent to ( p1() + p2() ) / 2, except it will never overflow.

PySide2.QtCore.QLine. dx ( )
返回类型

int

Returns the horizontal component of the line’s vector.

另请参阅

dy()

PySide2.QtCore.QLine. dy ( )
返回类型

int

Returns the vertical component of the line’s vector.

另请参阅

dx()

PySide2.QtCore.QLine. isNull ( )
返回类型

bool

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

PySide2.QtCore.QLine. __ne__ ( d )
参数

d QLine

返回类型

bool

返回 true 若给定 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.

PySide2.QtCore.QLine. __mul__ ( m )
参数

m QMatrix

返回类型

QLine

PySide2.QtCore.QLine. __mul__ ( m )
参数

m QTransform

返回类型

QLine

PySide2.QtCore.QLine. __eq__ ( d )
参数

d QLine

返回类型

bool

返回 true 若给定 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.

PySide2.QtCore.QLine. p1 ( )
返回类型

QPoint

Returns the line’s start point.

PySide2.QtCore.QLine. p2 ( )
返回类型

QPoint

Returns the line’s end point.

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

  • y1 int

  • x2 int

  • y2 int

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

PySide2.QtCore.QLine. setP1 ( p1 )
参数

p1 QPoint

Sets the starting point of this line to p1 .

另请参阅

setP2() p1()

PySide2.QtCore.QLine. setP2 ( p2 )
参数

p2 QPoint

Sets the end point of this line to p2 .

另请参阅

setP1() p2()

PySide2.QtCore.QLine. setPoints ( p1 , p2 )
参数

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

PySide2.QtCore.QLine. toTuple ( )
返回类型

PyObject

PySide2.QtCore.QLine. translate ( p )
参数

p QPoint

Translates this line by the given offset .

PySide2.QtCore.QLine. translate ( dx , dy )
参数
  • dx int

  • dy int

这是重载函数。

Translates this line the distance specified by dx and dy .

PySide2.QtCore.QLine. translated ( p )
参数

p QPoint

返回类型

QLine

Returns this line translated by the given offset .

PySide2.QtCore.QLine. translated ( dx , dy )
参数
  • dx int

  • dy int

返回类型

QLine

这是重载函数。

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

PySide2.QtCore.QLine. x1 ( )
返回类型

int

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

另请参阅

p1()

PySide2.QtCore.QLine. x2 ( )
返回类型

int

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

另请参阅

p2()

PySide2.QtCore.QLine. y1 ( )
返回类型

int

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

另请参阅

p1()

PySide2.QtCore.QLine. y2 ( )
返回类型

int

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

另请参阅

p2()