QtBase
v6.3.1
|
The QLine class provides a two-dimensional vector using integer precision. More...
#include <qline.h>
Public Member Functions | |
constexpr | QLine () |
constexpr | QLine (const QPoint &pt1, const QPoint &pt2) |
constexpr | QLine (int x1, int y1, int x2, int y2) |
constexpr bool | isNull () const |
constexpr QPoint | p1 () const |
constexpr QPoint | p2 () const |
constexpr int | x1 () const |
constexpr int | y1 () const |
constexpr int | x2 () const |
constexpr int | y2 () const |
constexpr int | dx () const |
constexpr int | dy () const |
void | translate (const QPoint &p) |
void | translate (int dx, int dy) |
constexpr QLine | translated (const QPoint &p) const |
constexpr QLine | translated (int dx, int dy) const |
constexpr QPoint | center () const |
void | setP1 (const QPoint &p1) |
void | setP2 (const QPoint &p2) |
void | setPoints (const QPoint &p1, const QPoint &p2) |
void | setLine (int x1, int y1, int x2, int y2) |
constexpr bool | operator== (const QLine &d) const noexcept |
constexpr bool | operator!= (const QLine &d) const noexcept |
Related Functions | |
(Note that these are not member functions.) | |
QDataStream & | operator<< (QDataStream &stream, const QLine &line) |
QDataStream & | operator>> (QDataStream &stream, QLine &line) |
The QLine class provides a two-dimensional vector using integer precision.
\inmodule QtCore
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.
\table \row
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.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexprnoexcept |
|
inlineconstexpr |
|
inlineconstexpr |
|
inline |
|
inline |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
related |
|
related |