QLine Class
The QLine class provides a two-dimensional vector using integer precision. More...
Header: | #include <QLine> |
qmake: | QT += core |
Related Non-Members
QDataStream & | operator<<(QDataStream &stream, const QLine &line) |
QDataStream & | operator>>(QDataStream &stream, QLine &line) |
Detailed Description
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() 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() function.
See also QLineF, QPolygon, and QRect.
Related Non-Members
QDataStream &QLine::operator<<(QDataStream &stream, const QLine &line)
Writes the given line to the given stream and returns a reference to the stream.
See also Serializing Qt Data Types.
QDataStream &QLine::operator>>(QDataStream &stream, QLine &line)
Reads a line from the given stream into the given line and returns a reference to the stream.
See also Serializing Qt Data Types.