QLine::translate: mark as constexpr
These functions were not constexpr, possibly because QLine was constexpr-ified in C++11 times, and these functions bodies require more than one line. This does not apply any more, so add constexpr. [ChangeLog][QtCore][QLine] The translate() overloads are now constexpr. [ChangeLog][QtCore][QLineF] The translate() overloads are now constexpr. Change-Id: Iee69a85b18ffa8d2533b0131f454546afeeba37a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
8047d2ec89
commit
034a234796
@ -36,8 +36,8 @@ public:
|
||||
constexpr inline int dx() const;
|
||||
constexpr inline int dy() const;
|
||||
|
||||
inline void translate(const QPoint &p);
|
||||
inline void translate(int dx, int dy);
|
||||
constexpr inline void translate(const QPoint &p);
|
||||
constexpr inline void translate(int dx, int dy);
|
||||
|
||||
[[nodiscard]] constexpr inline QLine translated(const QPoint &p) const;
|
||||
[[nodiscard]] constexpr inline QLine translated(int dx, int dy) const;
|
||||
@ -122,13 +122,13 @@ constexpr inline int QLine::dy() const
|
||||
return pt2.y() - pt1.y();
|
||||
}
|
||||
|
||||
inline void QLine::translate(const QPoint &point)
|
||||
constexpr inline void QLine::translate(const QPoint &point)
|
||||
{
|
||||
pt1 += point;
|
||||
pt2 += point;
|
||||
}
|
||||
|
||||
inline void QLine::translate(int adx, int ady)
|
||||
constexpr inline void QLine::translate(int adx, int ady)
|
||||
{
|
||||
this->translate(QPoint(adx, ady));
|
||||
}
|
||||
@ -231,8 +231,8 @@ public:
|
||||
IntersectionType intersects(const QLineF &l, QPointF *intersectionPoint = nullptr) const;
|
||||
|
||||
constexpr inline QPointF pointAt(qreal t) const;
|
||||
inline void translate(const QPointF &p);
|
||||
inline void translate(qreal dx, qreal dy);
|
||||
constexpr inline void translate(const QPointF &p);
|
||||
constexpr inline void translate(qreal dx, qreal dy);
|
||||
|
||||
[[nodiscard]] constexpr inline QLineF translated(const QPointF &p) const;
|
||||
[[nodiscard]] constexpr inline QLineF translated(qreal dx, qreal dy) const;
|
||||
@ -340,13 +340,13 @@ constexpr inline QLineF QLineF::normalVector() const
|
||||
return QLineF(p1(), p1() + QPointF(dy(), -dx()));
|
||||
}
|
||||
|
||||
inline void QLineF::translate(const QPointF &point)
|
||||
constexpr inline void QLineF::translate(const QPointF &point)
|
||||
{
|
||||
pt1 += point;
|
||||
pt2 += point;
|
||||
}
|
||||
|
||||
inline void QLineF::translate(qreal adx, qreal ady)
|
||||
constexpr inline void QLineF::translate(qreal adx, qreal ady)
|
||||
{
|
||||
this->translate(QPointF(adx, ady));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user