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); }
144 return pt2.
x() - pt1.
x();
149 return pt2.
y() - pt1.
y();
165 return QLine(pt1 + p, pt2 + p);
197 return pt1 == d.pt1 && pt2 == d.pt2;
200 #ifndef QT_NO_DEBUG_STREAM
204 #ifndef QT_NO_DATASTREAM
215 enum IntersectType { NoIntersection, BoundedIntersection, UnboundedIntersection };
219 inline QLineF(qreal x1, qreal y1, qreal x2, qreal y2);
220 inline QLineF(
const QLine &line) : pt1(line.p1()), pt2(line.p2()) { }
229 inline qreal x1()
const;
230 inline qreal y1()
const;
232 inline qreal x2()
const;
233 inline qreal y2()
const;
235 inline qreal
dx()
const;
236 inline qreal
dy()
const;
239 void setLength(qreal
len);
242 void setAngle(qreal angle);
244 qreal angleTo(
const QLineF &l)
const;
246 QLineF unitVector()
const;
247 QLineF normalVector()
const;
250 IntersectType intersect(
const QLineF &l,
QPointF *intersectionPoint)
const;
252 qreal angle(
const QLineF &l)
const;
255 inline void translate(
const QPointF &
p);
256 inline void translate(qreal
dx, qreal
dy);
259 inline QLineF translated(qreal
dx, qreal
dy)
const;
261 inline void setP1(
const QPointF &p1);
262 inline void setP2(
const QPointF &p2);
264 inline void setLine(qreal x1, qreal y1, qreal x2, qreal y2);
269 QLine toLine()
const;
285 : pt1(apt1), pt2(apt2)
290 : pt1(x1pos, y1pos), pt2(x2pos, y2pos)
326 return pt2.
x() - pt1.
x();
331 return pt2.
y() - pt1.
y();
352 return QLineF(pt1 + p, pt2 + p);
370 qreal vx = pt2.
x() - pt1.
x();
371 qreal vy = pt2.
y() - pt1.
y();
372 return QPointF(pt1.
x() + vx *
t, pt1.
y() + vy *
t);
406 return pt1 == d.pt1 && pt2 == d.pt2;
411 #ifndef QT_NO_DEBUG_STREAM
415 #ifndef QT_NO_DATASTREAM
QLineF(const QLine &line)
void translate(const QPointF &p)
QLineF translated(const QPointF &p) const
bool operator!=(const QLine &d) const
void setP2(const QPointF &p2)
void setLine(qreal x1, qreal y1, qreal x2, qreal y2)
void setPoints(const QPointF &p1, const QPointF &p2)
void setLine(int x1, int y1, int x2, int y2)
void setPoints(const QPoint &p1, const QPoint &p2)
bool operator==(const Attribute &cA, const AttributeInstance< type > &cB)
This operator compares the two attributes and NOT their values.
Q_CORE_EXPORT QDataStream & operator>>(QDataStream &, QLine &)
#define QT_BEGIN_NAMESPACE
void setLength(qreal len)
Q_CORE_EXPORT QDebug operator<<(QDebug d, const QLine &p)
bool operator==(const QLineF &d) const
QPointF pointAt(qreal t) const
bool operator!=(const QLineF &d) const
void setP2(const QPoint &p2)
bool operator==(const QLine &d) const
GLuint GLsizei GLsizei * length
QLineF normalVector() const
QLine translated(const QPoint &p) const
QLineF unitVector() const
void setP1(const QPointF &p1)
Q_DECLARE_TYPEINFO(QLine, Q_MOVABLE_TYPE)
void translate(const QPoint &p)
void setP1(const QPoint &p1)