tst_QComboBox: fix popupPositionAfterStyleChange() FAIL on Kubuntu 20.04

On my machine, the window manager opened the QComboBox always at y = 0
(top edge of the screen), where the popup, being confined to the
screen geometry, had no chance of "open[ing] up centered on top of the
current index".

Fix by centering the widget on screen.

Amends 8393922e7071221a9c6c0811eb714f20bf4ed02b.

Pick-to: 6.9 6.8 6.5
Change-Id: I7b4d066aa1e555f3d5cc1d5e0c88b1d835bf2b26
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
This commit is contained in:
Marc Mutz 2025-04-01 08:33:54 +02:00
parent e5f11eebc8
commit e2790a6758

View File

@ -3490,6 +3490,7 @@ void tst_QComboBox::popupPositionAfterStyleChange()
QSKIP("Flaky on QEMU, QTBUG-114760");
box.addItems({"first", "middle", "last"});
centerOnScreen(&box);
box.show();
QVERIFY(QTest::qWaitForWindowExposed(&box));
box.showPopup();