tst_qmenu: Fix funky use of QTRY_VERIFY with qWaitFor
The QTRY_VERIFY was needed because the window doesn't initially have a handle, and QTest::qWaitForWindowActive(QWidget *) only checks the active state of the widget if it does, returning false if not. This broken logic should be fixed, but for now let's make it clear what's actually going on by using an explicit wait for the window handle. Change-Id: I6dd89e0894efed14f4b9a2562dfe8ca76b5ef89c Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
parent
da62e76eac
commit
6b8e03456b
@ -724,7 +724,8 @@ void tst_QMenu::submenuTearOffDontClose()
|
||||
// Move then click to avoid the submenu moves from causing it to close
|
||||
QTest::mouseMove(menu, submenuPos, 100);
|
||||
QTest::mouseClick(menu, Qt::LeftButton, 0, submenuPos, 100);
|
||||
QTRY_VERIFY(QTest::qWaitForWindowActive(submenu));
|
||||
QVERIFY(QTest::qWaitFor([&]() { return submenu->window()->windowHandle(); }));
|
||||
QVERIFY(QTest::qWaitForWindowActive(submenu));
|
||||
// Make sure we enter the submenu frame directly on the tear-off area
|
||||
QTest::mouseMove(submenu, QPoint(10, 3), 100);
|
||||
if (submenu->style()->styleHint(QStyle::SH_Menu_SubMenuDontStartSloppyOnLeave)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user