summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets
diff options
context:
space:
mode:
authorAxel Spoerl <axel.spoerl@qt.io>2024-03-27 12:13:04 +0100
committerAxel Spoerl <axel.spoerl@qt.io>2024-04-04 16:13:28 +0200
commitf7a809ab73182ef25578eb8fd200c223fa3eb0f5 (patch)
tree75d766701e449995b54c6d1fd529a5b545b41f73 /tests/auto/widgets/widgets
parent02bab22fde5de84c62e3eb86fde03248851d11dd (diff)
Stabilize tst_QComboBox:popupPositionAfterStyleChange()
Wait 2x double click interval, to make sure a double click is safely avoided. Use QTRY_COMPARE at the end of the function, to cover cases where a synchronously delivered mouse click causes posted events. Wrap the test implementation in #ifndef QT_NO_STYLE_FUSION, as is the declaration. Skip the test on QNX. Fixes: QTBUG-123798 Pick-to: 6.7 6.6 6.5 Change-Id: I73f4acb241a8c77a542152288c65f3d07582e075 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'tests/auto/widgets/widgets')
-rw-r--r--tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
index d3199b689f..dc6ef789d7 100644
--- a/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
@@ -3416,8 +3416,12 @@ void tst_QComboBox::task_QTBUG_56693_itemFontFromModel()
box.hidePopup();
}
+#ifndef QT_NO_STYLE_FUSION
void tst_QComboBox::popupPositionAfterStyleChange()
{
+#ifdef Q_OS_QNX
+ QSKIP("Fails on QNX, QTBUG-123798");
+#endif
// Check that the popup opens up centered on top of the current
// index if the style has changed since the last time it was
// opened (QTBUG-113765).
@@ -3462,13 +3466,14 @@ void tst_QComboBox::popupPositionAfterStyleChange()
QTest::mouseClick(&box, Qt::LeftButton);
// Click on item under mouse. But wait a bit, to avoid a double click
- QTest::qWait(qApp->styleHints()->mouseDoubleClickInterval());
+ QTest::qWait(2 * QGuiApplication::styleHints()->mouseDoubleClickInterval());
QTest::mouseClick(&box, Qt::LeftButton);
// Ensure that the item that was centered on top of the combobox, and which
// we therefore clicked, was the same item we clicked on the first time.
- QCOMPARE(box.currentText(), QStringLiteral("last"));
+ QTRY_COMPARE(box.currentText(), QStringLiteral("last"));
}
+#endif // QT_NO_STYLE_FUSION
void tst_QComboBox::inputMethodUpdate()
{