diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2019-08-03 09:27:49 +0300 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2019-08-07 23:09:06 +0300 |
commit | 1563c38a4b46ad427907b544508e888efbac9772 (patch) | |
tree | ecacc6e204900f11a9973633d924dd70cbe7efff /tests | |
parent | 247ab241c783f776489d8bc348a84cb533079241 (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 'tests')
-rw-r--r-- | tests/auto/corelib/tools/qpoint/tst_qpoint.cpp | 7 | ||||
-rw-r--r-- | tests/auto/corelib/tools/qpointf/tst_qpointf.cpp | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp b/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp index 8e184f3ef3..f25492d2db 100644 --- a/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp +++ b/tests/auto/corelib/tools/qpoint/tst_qpoint.cpp @@ -42,6 +42,8 @@ private slots: void getSet_data(); void getSet(); + void transposed(); + void rx(); void ry(); @@ -126,6 +128,11 @@ void tst_QPoint::getSet() QCOMPARE(point.y(), i); } +void tst_QPoint::transposed() +{ + QCOMPARE(QPoint(1, 2).transposed(), QPoint(2, 1)); +} + void tst_QPoint::rx() { const QPoint originalPoint(-1, 0); diff --git a/tests/auto/corelib/tools/qpointf/tst_qpointf.cpp b/tests/auto/corelib/tools/qpointf/tst_qpointf.cpp index d4ccdf7ba6..e78a8e3082 100644 --- a/tests/auto/corelib/tools/qpointf/tst_qpointf.cpp +++ b/tests/auto/corelib/tools/qpointf/tst_qpointf.cpp @@ -46,6 +46,8 @@ private slots: void getSet_data(); void getSet(); + void transposed(); + void rx(); void ry(); @@ -154,6 +156,11 @@ void tst_QPointF::getSet() QCOMPARE(point.y(), r); } +void tst_QPointF::transposed() +{ + QCOMPARE(QPointF(1, 2).transposed(), QPointF(2, 1)); +} + void tst_QPointF::rx() { const QPointF originalPoint(-1, 0); |