summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qpoint.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-08-03 09:27:49 +0300
committerMarc Mutz <marc.mutz@kdab.com>2019-08-07 23:09:06 +0300
commit1563c38a4b46ad427907b544508e888efbac9772 (patch)
treeecacc6e204900f11a9973633d924dd70cbe7efff /src/corelib/tools/qpoint.h
parent247ab241c783f776489d8bc348a84cb533079241 (diff)
QPoint/F: add transposed()
For symmetry with QSize and QRect and because there were some users in Qt. Port those users. [ChangeLog][QtCore][QPoint/QPointF] Added transposed(). Change-Id: If4f23dbcf7d67983a6b1885e0d1d538115b49e2b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/tools/qpoint.h')
-rw-r--r--src/corelib/tools/qpoint.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/tools/qpoint.h b/src/corelib/tools/qpoint.h
index 34df673b93..fe952f95da 100644
--- a/src/corelib/tools/qpoint.h
+++ b/src/corelib/tools/qpoint.h
@@ -64,6 +64,8 @@ public:
Q_DECL_CONSTEXPR inline int manhattanLength() const;
+ Q_DECL_CONSTEXPR QPoint transposed() const noexcept { return {yp, xp}; }
+
Q_DECL_RELAXED_CONSTEXPR inline int &rx();
Q_DECL_RELAXED_CONSTEXPR inline int &ry();
@@ -232,6 +234,8 @@ public:
Q_DECL_RELAXED_CONSTEXPR inline void setX(qreal x);
Q_DECL_RELAXED_CONSTEXPR inline void setY(qreal y);
+ Q_DECL_CONSTEXPR QPointF transposed() const noexcept { return {yp, xp}; }
+
Q_DECL_RELAXED_CONSTEXPR inline qreal &rx();
Q_DECL_RELAXED_CONSTEXPR inline qreal &ry();