summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qpoint.cpp
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.cpp
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.cpp')
-rw-r--r--src/corelib/tools/qpoint.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/corelib/tools/qpoint.cpp b/src/corelib/tools/qpoint.cpp
index e98eaac4fc..432fb33297 100644
--- a/src/corelib/tools/qpoint.cpp
+++ b/src/corelib/tools/qpoint.cpp
@@ -138,6 +138,17 @@ QT_BEGIN_NAMESPACE
\sa y(), setX()
*/
+/*!
+ \fn QPoint::transposed() const
+ \since 5.14
+
+ Returns a point with x and y coordinates exchanged:
+ \code
+ QPoint{1, 2}.transposed() // {2, 1}
+ \endcode
+
+ \sa x(), y(), setX(), setY()
+*/
/*!
\fn int &QPoint::rx()
@@ -583,6 +594,18 @@ QDebug operator<<(QDebug dbg, const QPointF &p)
*/
/*!
+ \fn QPointF::transposed() const
+ \since 5.14
+
+ Returns a point with x and y coordinates exchanged:
+ \code
+ QPointF{1.0, 2.0}.transposed() // {2.0, 1.0}
+ \endcode
+
+ \sa x(), y(), setX(), setY()
+*/
+
+/*!
\fn qreal& QPointF::rx()
Returns a reference to the x coordinate of this point.