45 #include <QtCore/qpoint.h> 62 inline QLine(
int x1,
int y1,
int x2,
int y2);
64 inline bool isNull()
const;
69 inline int x1()
const;
70 inline int y1()
const;
72 inline int x2()
const;
73 inline int y2()
const;
75 inline int dx()
const;
76 inline int dy()
const;
78 inline void translate(
const QPoint &p);
79 inline void translate(
int dx,
int dy);
81 inline QLine translated(
const QPoint &p)
const;
82 inline QLine translated(
int dx,
int dy)
const;
84 inline void setP1(
const QPoint &p1);
85 inline void setP2(
const QPoint &p2);
86 inline void setPoints(
const QPoint &p1,
const QPoint &p2);
87 inline void setLine(
int x1,
int y1,
int x2,
int y2);
90 inline bool operator!=(
const QLine &d)
const {
return !(*
this ==
d); }
200 #ifndef QT_NO_DEBUG_STREAM 204 #ifndef QT_NO_DATASTREAM 215 enum IntersectType { NoIntersection, BoundedIntersection, UnboundedIntersection };
238 qreal length()
const;
239 void setLength(
qreal len);
242 void setAngle(
qreal angle);
246 QLineF unitVector()
const;
247 QLineF normalVector()
const;
269 QLine toLine()
const;
290 :
pt1(x1pos, y1pos),
pt2(x2pos, y2pos)
411 #ifndef QT_NO_DEBUG_STREAM 415 #ifndef QT_NO_DATASTREAM The QDebug class provides an output stream for debugging information.
bool operator==(const QLineF &d) const
Returns true if the given line is the same as this line.
void setP1(const QPointF &p1)
Sets the starting point of this line to p1.
QDataStream & operator>>(QDataStream &stream, QLine &line)
Reads a line from the given stream into the given line and returns a reference to the stream...
#define QT_END_NAMESPACE
This macro expands to.
bool isNull() const
Returns true if the line is not set up with valid start and end point; otherwise returns false...
The QLine class provides a two-dimensional vector using integer precision.
QPoint p1() const
Returns the line's start point.
qreal x2() const
Returns the x-coordinate of the line's end point.
QPointF p1() const
Returns the line's start point.
QPoint p2() const
Returns the line's end point.
qreal y2() const
Returns the y-coordinate of the line's end point.
The QPointF class defines a point in the plane using floating point precision.
void setP1(const QPoint &p1)
Sets the starting point of this line to p1.
void setPoints(const QPoint &p1, const QPoint &p2)
Sets the start point of this line to p1 and the end point of this line to p2.
void setPoints(const QPointF &p1, const QPointF &p2)
Sets the start point of this line to p1 and the end point of this line to p2.
qreal dy() const
Returns the vertical component of the line's vector.
QLineF unitVector() const
Returns the unit vector for this line, i.e a line starting at the same point as this line with a leng...
QDataStream & operator>>(QDataStream &stream, QLineF &line)
Reads a line from the given stream into the given line and returns a reference to the stream...
int y1() const
Returns the y-coordinate of the line's start point.
qreal x() const
Returns the x-coordinate of this point.
The QLineF class provides a two-dimensional vector using floating point precision.
void translate(const QPointF &p)
Translates this line by the given offset.
#define QT_BEGIN_NAMESPACE
This macro expands to.
void translate(const QPoint &p)
Translates this line by the given offset.
QDataStream & operator<<(QDataStream &stream, const QLineF &line)
Writes the given line to the given stream and returns a reference to the stream.
bool operator==(const QLine &d) const
Returns true if the given line is the same as this line.
QDataStream & operator<<(QDataStream &stream, const QLine &line)
Writes the given line to the given stream and returns a reference to the stream.
IntersectType
Describes the intersection between two lines.
qreal y1() const
Returns the y-coordinate of the line's start point.
void setP2(const QPointF &p2)
Sets the end point of this line to p2.
int x2() const
Returns the x-coordinate of the line's end point.
QLineF translated(const QPointF &p) const
Returns this line translated by the given offset.
void setLength(qreal len)
Sets the length of the line to the given length.
qreal dx() const
Returns the horizontal component of the line's vector.
int dx() const
Returns the horizontal component of the line's vector.
qreal angle(const QPointF &p1, const QPointF &p2)
int dy() const
Returns the vertical component of the line's vector.
bool operator!=(const QLine &d) const
Returns true if the given line is not the same as this line.
QLine()
Constructs a null line.
QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
The QPoint class defines a point in the plane using integer precision.
QPointF p2() const
Returns the line's end point.
void setP2(const QPoint &p2)
Sets the end point of this line to p2.
bool operator==(const T *o, const QPointer< T > &p)
int y() const
Returns the y coordinate of this point.
bool operator!=(const QLineF &d) const
Returns true if the given line is not the same as this line.
qreal y() const
Returns the y-coordinate of this point.
QLineF normalVector() const
Returns a line that is perpendicular to this line with the same starting point and length...
Q_DECLARE_TYPEINFO(QLine, Q_MOVABLE_TYPE)
The QDataStream class provides serialization of binary data to a QIODevice.
int y2() const
Returns the y-coordinate of the line's end point.
int x() const
Returns the x coordinate of this point.
QLineF(const QLine &line)
Construct a QLineF object from the given integer-based line.
QLineF()
Constructs a null line.
QLine toLine() const
Returns an integer based copy of this line.
qreal x1() const
Returns the x-coordinate of the line's start point.
int x1() const
Returns the x-coordinate of the line's start point.
QLine translated(const QPoint &p) const
Returns this line translated by the given offset.
bool isNull() const
Returns true if the line is not set up with valid start and end point; otherwise returns false...
static bool isNull(const QVariant::Private *d)
void setLine(qreal x1, qreal y1, qreal x2, qreal y2)
Sets this line to the start in x1, y1 and end in x2, y2.
void setLine(int x1, int y1, int x2, int y2)
Sets this line to the start in x1, y1 and end in x2, y2.
QPointF pointAt(qreal t) const
Returns the point at the parameterized position specified by t.