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.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> (cherry picked from commit f7a809ab73182ef25578eb8fd200c223fa3eb0f5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
2cd1cd1541
commit
2425bce76d
@ -3415,8 +3415,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).
|
||||
@ -3461,13 +3465,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()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user