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.
|
|
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() 函数。
| 参数: |
|
|---|
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 ).
| 返回类型: | PyObject |
|---|
| 返回类型: | PyObject |
|---|
| 返回类型: | PySide.QtCore.int |
|---|
Returns the horizontal component of the line's vector.
| 返回类型: | PySide.QtCore.int |
|---|
Returns the vertical component of the line's vector.
| 返回类型: | PySide.QtCore.bool |
|---|
Returns true if the line is not set up with valid start and end point; otherwise returns false.
| 参数: | 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.
| 参数: | m – PySide.QtGui.QTransform |
|---|---|
| 返回类型: | PySide.QtCore.QLine |
| 参数: | m – PySide.QtGui.QMatrix |
|---|---|
| 返回类型: | PySide.QtCore.QLine |
| 参数: | 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.QPoint |
|---|
Returns the line's start point.
| 返回类型: | PySide.QtCore.QPoint |
|---|
Returns the line's end point.
| 参数: |
|
|---|
Sets this line to the start in x1 , y1 and end in x2 , y2 .
| 参数: | p1 – PySide.QtCore.QPoint |
|---|
Sets the starting point of this line to p1 .
| 参数: | p2 – PySide.QtCore.QPoint |
|---|
Sets the end point of this line to p2 .
| 参数: |
|
|---|
Sets the start point of this line to p1 and the end point of this line to p2 .
| 返回类型: | PyObject |
|---|
| 参数: |
|
|---|
这是重载函数。
Translates this line the distance specified by dx and dy .
| 参数: | p – PySide.QtCore.QPoint |
|---|
Translates this line by the given offset .
| 参数: | p – PySide.QtCore.QPoint |
|---|---|
| 返回类型: | PySide.QtCore.QLine |
Returns this line translated by the given offset .
| 参数: |
|
|---|---|
| 返回类型: |
这是重载函数。
Returns this line translated the distance specified by dx and dy .
| 返回类型: | PySide.QtCore.int |
|---|
Returns the x-coordinate of the line's start point.
| 返回类型: | PySide.QtCore.int |
|---|
Returns the x-coordinate of the line's end point.
| 返回类型: | PySide.QtCore.int |
|---|
Returns the y-coordinate of the line's start point.
| 返回类型: | PySide.QtCore.int |
|---|
Returns the y-coordinate of the line's end point.