From af2daafde72db02454d24b7d691aa6861525ab99 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 18 Nov 2019 17:01:26 +0100 Subject: 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 --- tests/auto/testlib/selftests/mouse/tst_mouse.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'tests/auto/testlib') 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); -- cgit v1.2.3