summaryrefslogtreecommitdiffstats
path: root/tests/auto/testlib
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-11-18 17:01:26 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-11-20 19:43:38 +0100
commitaf2daafde72db02454d24b7d691aa6861525ab99 (patch)
treeb59c47baf8af94a6ace5cbf4338944272e40e32b /tests/auto/testlib
parent8bc4ea1e97c138034d08c705a75f75763361400b (diff)
Deprecate constructing QFlags from a pointer
This was used to support QFlags f = 0 initialization, but with 0 used as a pointer literal now considered bad form, it had been changed many places to QFlags f = nullptr, which is meaningless and confusing. Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/testlib')
-rw-r--r--tests/auto/testlib/selftests/mouse/tst_mouse.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/auto/testlib/selftests/mouse/tst_mouse.cpp b/tests/auto/testlib/selftests/mouse/tst_mouse.cpp
index 3c731cde69..d097027e7e 100644
--- a/tests/auto/testlib/selftests/mouse/tst_mouse.cpp
+++ b/tests/auto/testlib/selftests/mouse/tst_mouse.cpp
@@ -93,31 +93,31 @@ void tst_Mouse::stateHandlingPart1()
// verify that we have a clean state after the previous data set
QCOMPARE(QTestPrivate::qtestMouseButtons, Qt::NoButton);
- QTest::mousePress(&w, Qt::LeftButton, 0, point);
+ QTest::mousePress(&w, Qt::LeftButton, { }, point);
QCOMPARE(QTestPrivate::qtestMouseButtons, Qt::LeftButton);
- QTest::mousePress(&w, Qt::RightButton, 0, point);
+ QTest::mousePress(&w, Qt::RightButton, { }, point);
QCOMPARE(QTestPrivate::qtestMouseButtons, Qt::LeftButton | Qt::RightButton);
QTest::mouseMove(&w, point += step);
QCOMPARE(QTestPrivate::qtestMouseButtons, Qt::LeftButton | Qt::RightButton);
- QTest::mouseRelease(&w, Qt::LeftButton, 0, point);
+ QTest::mouseRelease(&w, Qt::LeftButton, { }, point);
QCOMPARE(QTestPrivate::qtestMouseButtons, Qt::RightButton);
QTest::mouseMove(&w, point += step);
QCOMPARE(QTestPrivate::qtestMouseButtons, Qt::RightButton);
// test invalid input - left button was already released
- QTest::mouseRelease(&w, Qt::LeftButton, 0, point += point);
+ QTest::mouseRelease(&w, Qt::LeftButton, { }, point += point);
QCOMPARE(QTestPrivate::qtestMouseButtons, Qt::RightButton);
// test invalid input - right button is already pressed
- QTest::mousePress(&w, Qt::RightButton, 0, point);
+ QTest::mousePress(&w, Qt::RightButton, { }, point);
QCOMPARE(QTestPrivate::qtestMouseButtons, Qt::RightButton);
// now continue with valid input
- QTest::mouseRelease(&w, Qt::RightButton, 0, point += point);
+ QTest::mouseRelease(&w, Qt::RightButton, { }, point += point);
QCOMPARE(QTestPrivate::qtestMouseButtons, Qt::NoButton);
QTest::mouseMove(&w, point += step);
QCOMPARE(QTestPrivate::qtestMouseButtons, Qt::NoButton);
// exit this test function with some button in a pressed state
- QTest::mousePress(&w, Qt::LeftButton, 0, point);
- QTest::mousePress(&w, Qt::RightButton, 0, point);
+ QTest::mousePress(&w, Qt::LeftButton, { }, point);
+ QTest::mousePress(&w, Qt::RightButton, { }, point);
QCOMPARE(QTestPrivate::qtestMouseButtons, Qt::LeftButton | Qt::RightButton);
}
@@ -144,8 +144,8 @@ void tst_Mouse::stateHandlingPart2()
QSKIP("Not implemented beyond this point!");
QPoint point(40, 40);
- QTest::mousePress(&w, Qt::LeftButton, 0, point);
- QTest::mousePress(&w, Qt::RightButton, 0, point);
+ QTest::mousePress(&w, Qt::LeftButton, { }, point);
+ QTest::mousePress(&w, Qt::RightButton, { }, point);
QCOMPARE(QTestPrivate::qtestMouseButtons, Qt::LeftButton | Qt::RightButton);
w.moveCount = 0;
// The windowing system will send mouse events with no buttons set
@@ -201,11 +201,11 @@ void tst_Mouse::deterministicEvents()
QCOMPARE(w.moveCount, 0);
static QPoint m_cachedLastCursorPosition;
if (firstRun) {
- QTest::mousePress(&w, Qt::LeftButton, 0, QPoint(40, 40));
+ QTest::mousePress(&w, Qt::LeftButton, { }, QPoint(40, 40));
m_cachedLastCursorPosition = QGuiApplicationPrivate::lastCursorPosition.toPoint();
} else {
QPoint point = w.mapFromGlobal(m_cachedLastCursorPosition);
- QTest::mousePress(&w, Qt::LeftButton, 0, point);
+ QTest::mousePress(&w, Qt::LeftButton, { }, point);
}
QCOMPARE(w.pressCount, 1);
QCOMPARE(w.moveCount, 1);