diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-04-17 09:48:33 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-04-20 10:15:59 +0200 |
commit | b9389fe005ad2daf37d236a5f661a901e90c7640 (patch) | |
tree | 542753080d2688626bd6b2d7e9c15157c4b7c274 /tests/auto | |
parent | 3401f2e7a9b534b5795a7e46cee72a73487bfe2b (diff) |
Remove qWaitForWindowShown hack, use qWaitForWindowExposed instead
The method has been deprecated since Qt 5.0.
Change-Id: I59587833d8d31de9345b3005014b06ce3dd53973
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/inc/tst_definitions.h | 13 | ||||
-rw-r--r-- | tests/auto/qvalueaxis/tst_qvalueaxis.cpp | 2 |
2 files changed, 2 insertions, 13 deletions
diff --git a/tests/auto/inc/tst_definitions.h b/tests/auto/inc/tst_definitions.h index 7e0cfcff..67cd4b65 100644 --- a/tests/auto/inc/tst_definitions.h +++ b/tests/auto/inc/tst_definitions.h @@ -34,17 +34,6 @@ #include <QtTest/QtTest> #include <QtWidgets/QPushButton> -QT_BEGIN_NAMESPACE -namespace QTest -{ - // This was deprecated in Qt5. This is a small hack for the sake of compatibility. - inline static bool qWaitForWindowShown(QWidget *window) - { - return QTest::qWaitForWindowExposed(window); - } -} -QT_END_NAMESPACE - #define TRY_COMPARE(actual, expected) { \ do { \ const int timeout(1000); \ @@ -65,7 +54,7 @@ QT_END_NAMESPACE QPushButton b; \ b.resize(120, 100); \ b.show(); \ - QTest::qWaitForWindowShown(&b); \ + QTest::qWaitForWindowExposed(&b); \ QSignalSpy spy(&b, SIGNAL(clicked())); \ QTest::mouseClick(&b, Qt::LeftButton, {}, b.rect().center()); \ QApplication::processEvents(); \ diff --git a/tests/auto/qvalueaxis/tst_qvalueaxis.cpp b/tests/auto/qvalueaxis/tst_qvalueaxis.cpp index 7bedee0b..72e933db 100644 --- a/tests/auto/qvalueaxis/tst_qvalueaxis.cpp +++ b/tests/auto/qvalueaxis/tst_qvalueaxis.cpp @@ -501,7 +501,7 @@ void tst_QValueAxis::dynamicTicks() valuesaxis->setTickInterval(50.0); valuesaxis->setLabelFormat("%.2f"); m_view->show(); - QTest::qWaitForWindowShown(m_view); + QTest::qWaitForWindowExposed(m_view); QStringList expectedList; expectedList << "" << "100.00" << "50.00" << "0.00" << "-50.00" << "-100.00" << |