7#include <QtCore/qpoint.h>
20 constexpr inline QLine();
24 constexpr inline bool isNull()
const;
29 constexpr inline int x1()
const;
30 constexpr inline int y1()
const;
32 constexpr inline int x2()
const;
33 constexpr inline int y2()
const;
35 constexpr inline int dx()
const;
36 constexpr inline int dy()
const;
41 [[nodiscard]]
constexpr inline QLine translated(
const QPoint &
p)
const;
42 [[nodiscard]]
constexpr inline QLine translated(
int dx,
int dy)
const;
44 [[nodiscard]]
constexpr inline QPoint center()
const;
49 inline void setLine(
int x1,
int y1,
int x2,
int y2);
51#if QT_CORE_REMOVED_SINCE(6, 8)
56 [[nodiscard]]
constexpr inline QLineF toLineF()
const noexcept;
60 {
return lhs.pt1 == rhs.pt1 && lhs.pt2 == rhs.pt2; }
61#if !QT_CORE_REMOVED_SINCE(6, 8)
77constexpr inline QLine::QLine(
int x1pos,
int y1pos,
int x2pos,
int y2pos) : pt1(
QPoint(x1pos, y1pos)), pt2(
QPoint(x2pos, y2pos)) { }
116 return pt2.
x() - pt1.
x();
121 return pt2.
y() - pt1.
y();
137 return QLine(pt1 +
p, pt2 +
p);
172#if QT_CORE_REMOVED_SINCE(6, 8)
173constexpr inline bool QLine::operator==(
const QLine &
d)
const noexcept
179#ifndef QT_NO_DEBUG_STREAM
183#ifndef QT_NO_DATASTREAM
198 constexpr inline QLineF();
205 constexpr bool isNull()
const;
210 constexpr inline qreal x1()
const;
211 constexpr inline qreal y1()
const;
213 constexpr inline qreal x2()
const;
214 constexpr inline qreal y2()
const;
216 constexpr inline qreal dx()
const;
217 constexpr inline qreal dy()
const;
227 [[nodiscard]]
QLineF unitVector()
const;
228 [[nodiscard]]
constexpr inline QLineF normalVector()
const;
230 IntersectionType intersects(
const QLineF &l,
QPointF *intersectionPoint =
nullptr)
const;
236 [[nodiscard]]
constexpr inline QLineF translated(
const QPointF &
p)
const;
239 [[nodiscard]]
constexpr inline QPointF center()
const;
246#if QT_CORE_REMOVED_SINCE(6, 8)
251 constexpr QLine toLine()
const;
255 {
return lhs.pt1 == rhs.pt1 && lhs.pt2 == rhs.pt2; }
256#if !QT_CORE_REMOVED_SINCE(6, 8)
283 : pt1(apt1), pt2(apt2)
288 : pt1(x1pos, y1pos), pt2(x2pos, y2pos)
329 return pt2.
x() - pt1.
x();
334 return pt2.
y() - pt1.
y();
365 return QPointF(0.5 * pt1.
x() + 0.5 * pt2.
x(), 0.5 * pt1.
y() + 0.5 * pt2.
y());
381 return QPointF(pt1.
x() + (pt2.
x() - pt1.
x()) *
t, pt1.
y() + (pt2.
y() - pt1.
y()) *
t);
388 return QLine(pt1.toPoint(), pt2.toPoint());
414#if QT_CORE_REMOVED_SINCE(6, 8)
415constexpr inline bool QLineF::operator==(
const QLineF &
d)
const
422#ifndef QT_NO_DEBUG_STREAM
426#ifndef QT_NO_DATASTREAM
\inmodule QtCore\reentrant
\inmodule QtCore\compares equality \compareswith equality QLine \endcompareswith
constexpr QPointF p1() const
Returns the line's start point.
constexpr qreal x1() const
Returns the x-coordinate of the line's start point.
constexpr QLine toLine() const
Returns an integer-based copy of this line.
void setP2(const QPointF &p2)
constexpr bool isNull() const
Returns true if the line does not have distinct start and end points; otherwise returns false.
constexpr qreal y2() const
Returns the y-coordinate of the line's end point.
friend constexpr bool qFuzzyCompare(const QLineF &lhs, const QLineF &rhs) noexcept
friend constexpr bool comparesEqual(const QLineF &lhs, const QLineF &rhs) noexcept
void translate(const QPointF &p)
Translates this line by the given offset.
constexpr qreal dx() const
Returns the horizontal component of the line's vector.
void setPoints(const QPointF &p1, const QPointF &p2)
constexpr QLineF translated(const QPointF &p) const
constexpr qreal dy() const
Returns the vertical component of the line's vector.
constexpr QLineF()
Constructs a null line.
qreal length() const
Returns the length of the line.
IntersectionType
\typealias QLineF::IntersectType
constexpr QLineF(const QLine &line)
Construct a QLineF object from the given integer-based line.
friend constexpr bool comparesEqual(const QLineF &lhs, const QLine &rhs) noexcept
constexpr QLineF normalVector() const
Returns a line that is perpendicular to this line with the same starting point and length.
constexpr QPointF center() const
friend constexpr bool qFuzzyIsNull(const QLineF &line) noexcept
void setP1(const QPointF &p1)
constexpr qreal x2() const
Returns the x-coordinate of the line's end point.
constexpr QPointF p2() const
Returns the line's end point.
constexpr QPointF pointAt(qreal t) const
Returns the point at the position specified by finite parameter t.
void setLine(qreal x1, qreal y1, qreal x2, qreal y2)
void setLength(qreal len)
Sets the length of the line to the given finite length.
constexpr qreal y1() const
Returns the y-coordinate of the line's start point.
\inmodule QtCore\compares equality \compareswith equality QLineF \endcompareswith
constexpr int x2() const
Returns the x-coordinate of the line's end point.
void setPoints(const QPoint &p1, const QPoint &p2)
constexpr int y2() const
Returns the y-coordinate of the line's end point.
constexpr int y1() const
Returns the y-coordinate of the line's start point.
friend constexpr bool comparesEqual(const QLine &lhs, const QLine &rhs) noexcept
constexpr int dx() const
Returns the horizontal component of the line's vector.
constexpr QLine()
Constructs a null line.
void setP2(const QPoint &p2)
void setLine(int x1, int y1, int x2, int y2)
constexpr QPoint p1() const
Returns the line's start point.
constexpr QPoint p2() const
Returns the line's end point.
constexpr int x1() const
Returns the x-coordinate of the line's start point.
constexpr int dy() const
Returns the vertical component of the line's vector.
constexpr bool isNull() const
Returns true if the line does not have distinct start and end points; otherwise returns false.
constexpr QLine translated(const QPoint &p) const
void setP1(const QPoint &p1)
constexpr QLineF toLineF() const noexcept
void translate(const QPoint &p)
Translates this line by the given offset.
constexpr QPoint center() const
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
Combined button and popup list for selecting options.
#define Q_DECLARE_EQUALITY_COMPARABLE_LITERAL_TYPE(...)
constexpr bool operator!=(const timespec &t1, const timespec &t2)
bool comparesEqual(const QDir &lhs, const QDir &rhs)
bool qIsFinite(qfloat16 f) noexcept
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
Q_CORE_EXPORT QDebug operator<<(QDebug d, const QLine &p)
Q_CORE_EXPORT QDataStream & operator>>(QDataStream &, QLine &)
GLuint GLfloat GLfloat GLfloat GLfloat y1
GLuint GLfloat GLfloat GLfloat x1
GLenum GLuint GLenum GLsizei length
GLfixed GLfixed GLfixed y2
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
static bool translate(xcb_connection_t *connection, xcb_window_t child, xcb_window_t parent, int *x, int *y)