The QLine class provides a two-dimensional vector using integer precision. 更多...
This class can be pickled.
The QLine class provides a two-dimensional vector using integer precision.
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.
|
|
The positions of the line's start and end points can be retrieved using the p1 (), x1 (), y1 (), p2 (), x2 (), and y2 () functions. The dx () 和 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 () 函数。
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 ).
Returns the horizontal component of the line's vector.
另请参阅 dy ().
Returns the vertical component of the line's vector.
另请参阅 dx ().
Returns true if the line is not set up with valid start and end point; otherwise returns false.
Returns the line's start point.
另请参阅 setP1 (), x1 (), y1 (),和 p2 ().
Returns the line's end point.
另请参阅 setP2 (), x2 (), y2 (),和 p1 ().
Sets this line to the start in x1 , y1 and end in x2 , y2 .
该函数在 Qt 4.4 引入。
另请参阅 setP1 (), setP2 (), p1 (), and p2 ().
Sets the starting point of this line to p1 .
该函数在 Qt 4.4 引入。
Sets the end point of this line to p2 .
该函数在 Qt 4.4 引入。
Sets the start point of this line to p1 and the end point of this line to p2 .
该函数在 Qt 4.4 引入。
另请参阅 setP1 (), setP2 (), p1 (), and p2 ().
Translates this line by the given offset .
这是重载函数。
Translates this line the distance specified by dx and dy .
Returns this line translated by the given offset .
该函数在 Qt 4.4 引入。
这是重载函数。
Returns this line translated the distance specified by dx and dy .
该函数在 Qt 4.4 引入。
Returns the x-coordinate of the line's start point.
另请参阅 p1 ().
Returns the x-coordinate of the line's end point.
另请参阅 p2 ().
Returns the y-coordinate of the line's start point.
另请参阅 p1 ().
Returns the y-coordinate of the line's end point.
另请参阅 p2 ().
This method is only available if the QtGui module is imported.
This method is only available if the QtGui module is imported.