From 6ee6c52b57a0fbe9df00b30616afd90476ebdfd6 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 21 Jul 2020 12:16:09 +0200 Subject: Properly deprecate Qt::MidButton in favor of Qt::MiddleButton MidButton had its // ### Qt 5: remove me upgraded to Qt 6 at 5.0; but it dates back to 4.7.0 Replace the many remaining uses of MidButton with MiddleButton in the process. Change-Id: Idc1b1b1816673dfdb344d703d101febc823a76ff Reviewed-by: Lars Knoll (cherry picked from commit 16e546e32fec393bc3b126f280114bcbfa7151ff) Reviewed-by: Qt Cherry-pick Bot --- tests/auto/corelib/global/qflags/tst_qflags.cpp | 6 +++--- .../auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp | 20 ++++++++++---------- tests/auto/other/macnativeevents/qnativeevents.cpp | 8 ++++---- 3 files changed, 17 insertions(+), 17 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/global/qflags/tst_qflags.cpp b/tests/auto/corelib/global/qflags/tst_qflags.cpp index be75f5b3cc..c679fbd8e3 100644 --- a/tests/auto/corelib/global/qflags/tst_qflags.cpp +++ b/tests/auto/corelib/global/qflags/tst_qflags.cpp @@ -47,7 +47,7 @@ void tst_QFlags::testFlag() const Qt::MouseButtons btn = Qt::LeftButton | Qt::RightButton; QVERIFY(btn.testFlag(Qt::LeftButton)); - QVERIFY(!btn.testFlag(Qt::MidButton)); + QVERIFY(!btn.testFlag(Qt::MiddleButton)); btn = { }; QVERIFY(!btn.testFlag(Qt::LeftButton)); @@ -275,11 +275,11 @@ void tst_QFlags::testSetFlags() btn.setFlag(Qt::LeftButton); QVERIFY(btn.testFlag(Qt::LeftButton)); - QVERIFY(!btn.testFlag(Qt::MidButton)); + QVERIFY(!btn.testFlag(Qt::MiddleButton)); btn.setFlag(Qt::LeftButton, false); QVERIFY(!btn.testFlag(Qt::LeftButton)); - QVERIFY(!btn.testFlag(Qt::MidButton)); + QVERIFY(!btn.testFlag(Qt::MiddleButton)); MyStrictFlags flags; flags.setFlag(MyStrictEnum::StrictOne); diff --git a/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp b/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp index a1de205571..12af947fd9 100644 --- a/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp +++ b/tests/auto/gui/kernel/qmouseevent/tst_qmouseevent.cpp @@ -143,11 +143,11 @@ void tst_QMouseEvent::checkMousePressEvent_data() QTest::newRow("rightButton-controlkey") << int(Qt::RightButton) << int(Qt::ControlModifier); QTest::newRow("rightButton-altkey") << int(Qt::RightButton) << int(Qt::AltModifier); QTest::newRow("rightButton-metakey") << int(Qt::RightButton) << int(Qt::MetaModifier); - QTest::newRow("midButton-nokey") << int(Qt::MidButton) << int(Qt::NoButton); - QTest::newRow("midButton-shiftkey") << int(Qt::MidButton) << int(Qt::ShiftModifier); - QTest::newRow("midButton-controlkey") << int(Qt::MidButton) << int(Qt::ControlModifier); - QTest::newRow("midButton-altkey") << int(Qt::MidButton) << int(Qt::AltModifier); - QTest::newRow("midButton-metakey") << int(Qt::MidButton) << int(Qt::MetaModifier); + QTest::newRow("middleButton-nokey") << int(Qt::MiddleButton) << int(Qt::NoButton); + QTest::newRow("middleButton-shiftkey") << int(Qt::MiddleButton) << int(Qt::ShiftModifier); + QTest::newRow("middleButton-controlkey") << int(Qt::MiddleButton) << int(Qt::ControlModifier); + QTest::newRow("middleButton-altkey") << int(Qt::MiddleButton) << int(Qt::AltModifier); + QTest::newRow("middleButton-metakey") << int(Qt::MiddleButton) << int(Qt::MetaModifier); } void tst_QMouseEvent::checkMousePressEvent() @@ -184,11 +184,11 @@ void tst_QMouseEvent::checkMouseReleaseEvent_data() QTest::newRow("rightButton-controlkey") << int(Qt::RightButton) << int(Qt::ControlModifier); QTest::newRow("rightButton-altkey") << int(Qt::RightButton) << int(Qt::AltModifier); QTest::newRow("rightButton-metakey") << int(Qt::RightButton) << int(Qt::MetaModifier); - QTest::newRow("midButton-nokey") << int(Qt::MidButton) << int(Qt::NoButton); - QTest::newRow("midButton-shiftkey") << int(Qt::MidButton) << int(Qt::ShiftModifier); - QTest::newRow("midButton-controlkey") << int(Qt::MidButton) << int(Qt::ControlModifier); - QTest::newRow("midButton-altkey") << int(Qt::MidButton) << int(Qt::AltModifier); - QTest::newRow("midButton-metakey") << int(Qt::MidButton) << int(Qt::MetaModifier); + QTest::newRow("middleButton-nokey") << int(Qt::MiddleButton) << int(Qt::NoButton); + QTest::newRow("middleButton-shiftkey") << int(Qt::MiddleButton) << int(Qt::ShiftModifier); + QTest::newRow("middleButton-controlkey") << int(Qt::MiddleButton) << int(Qt::ControlModifier); + QTest::newRow("middleButton-altkey") << int(Qt::MiddleButton) << int(Qt::AltModifier); + QTest::newRow("middleButton-metakey") << int(Qt::MiddleButton) << int(Qt::MetaModifier); } void tst_QMouseEvent::checkMouseReleaseEvent() diff --git a/tests/auto/other/macnativeevents/qnativeevents.cpp b/tests/auto/other/macnativeevents/qnativeevents.cpp index f04b33151a..970c41bf2e 100644 --- a/tests/auto/other/macnativeevents/qnativeevents.cpp +++ b/tests/auto/other/macnativeevents/qnativeevents.cpp @@ -130,8 +130,8 @@ static QString getButtonAsString(const QNativeMouseButtonEvent *e) case Qt::RightButton: return "button = RightButton"; break; - case Qt::MidButton: - return "button = MidButton"; + case Qt::MiddleButton: + return "button = MiddleButton"; break; default: return "button = Other"; @@ -292,7 +292,7 @@ QTextStream &operator>>(QTextStream &s, QNativeMouseButtonEvent *e) e->button = Qt::RightButton; break; case 3: - e->button = Qt::MidButton; + e->button = Qt::MiddleButton; break; default: e->button = Qt::NoButton; @@ -319,7 +319,7 @@ QTextStream &operator>>(QTextStream &s, QNativeMouseDragEvent *e) e->button = Qt::RightButton; break; case 3: - e->button = Qt::MidButton; + e->button = Qt::MiddleButton; break; default: e->button = Qt::NoButton; -- cgit v1.2.3