The 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() , and 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() function.
Parameters: |
|
---|
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 ) and (x2 , y2 ).
Return type: | PyObject |
---|
Return type: | PyObject |
---|
Return type: | PySide.QtCore.int |
---|
Returns the horizontal component of the line’s vector.
See also
Return type: | PySide.QtCore.int |
---|
Returns the vertical component of the line’s vector.
See also
Return type: | PySide.QtCore.bool |
---|
Returns true if the line is not set up with valid start and end point; otherwise returns false.
Parameters: | d – PySide.QtCore.QLine |
---|---|
Return type: | 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.
Parameters: | m – PySide.QtGui.QTransform |
---|---|
Return type: | PySide.QtCore.QLine |
Parameters: | m – PySide.QtGui.QMatrix |
---|---|
Return type: | PySide.QtCore.QLine |
Parameters: | d – PySide.QtCore.QLine |
---|---|
Return type: | PySide.QtCore.bool |
Returns true if the given line is the same as 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.
Return type: | PySide.QtCore.QPoint |
---|
Returns the line’s start point.
Return type: | PySide.QtCore.QPoint |
---|
Returns the line’s end point.
Parameters: |
|
---|
Sets this line to the start in x1 , y1 and end in x2 , y2 .
Parameters: | p1 – PySide.QtCore.QPoint |
---|
Sets the starting point of this line to p1 .
Parameters: | p2 – PySide.QtCore.QPoint |
---|
Sets the end point of this line to p2 .
Parameters: |
|
---|
Sets the start point of this line to p1 and the end point of this line to p2 .
Return type: | PyObject |
---|
Parameters: |
|
---|
This is an overloaded function.
Translates this line the distance specified by dx and dy .
Parameters: | p – PySide.QtCore.QPoint |
---|
Translates this line by the given offset .
Parameters: | p – PySide.QtCore.QPoint |
---|---|
Return type: | PySide.QtCore.QLine |
Returns this line translated by the given offset .
Parameters: |
|
---|---|
Return type: |
This is an overloaded function.
Returns this line translated the distance specified by dx and dy .
Return type: | PySide.QtCore.int |
---|
Returns the x-coordinate of the line’s start point.
See also
Return type: | PySide.QtCore.int |
---|
Returns the x-coordinate of the line’s end point.
See also
Return type: | PySide.QtCore.int |
---|
Returns the y-coordinate of the line’s start point.
See also
Return type: | PySide.QtCore.int |
---|
Returns the y-coordinate of the line’s end point.
See also