aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorYuya Nishihara <yuya.nishihara@qt.io>2020-09-01 10:52:35 +0900
committerYuya Nishihara <yuya.nishihara@qt.io>2020-09-02 10:45:00 +0900
commit6a2f7994e8255107954c11d48595dd171d0102b8 (patch)
tree4cbc18a84f6bfc201fe083267435fb35e3cb9069 /tests/auto
parentde007e507ca2693203d15506aede3294e6236a83 (diff)
Menu: Update mnemonic tests to wait until menu is fully closed
Otherwise tst_qquickmenubar of Material style would fail as follows: 1. Type Alt+E to open Edit menu 2. Type Alt+H to switch to Help menu Since the key events of (2) are generated really quick, (2) wouldn't open the Help menu. The Edit menu still exists in the popup stack and blocks the MenuBar shortcuts. I originally thought the closing popup shouldn't block the parent shortcuts. for (QQuickPopup *popup : popups) { if (qobject_cast<QQuickToolTip *>(popup)) continue; // ignore tooltips (QTBUG-60492) + if (!popup->isOpened()) + continue; // closing, or not yet fully open However, the shortcuts in the closing popup are enabled until the popup gets invisible. So changing the resolution of ambiguous shortcuts would introduce another inconsistency. For example, unambiguous shortcut in the closing popup could be triggered, whereas ambiguous one wouldn't win because of the registration order. Task-number: QTBUG-86276 Pick-to: 5.15 Change-Id: I3510cc7a06294e1d1d3512297fc9389bddc4da3b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qquickmenubar/tst_qquickmenubar.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/qquickmenubar/tst_qquickmenubar.cpp b/tests/auto/qquickmenubar/tst_qquickmenubar.cpp
index 62cb7363..f18eabc7 100644
--- a/tests/auto/qquickmenubar/tst_qquickmenubar.cpp
+++ b/tests/auto/qquickmenubar/tst_qquickmenubar.cpp
@@ -464,6 +464,7 @@ void tst_qquickmenubar::mnemonics()
// trigger another menubar item to open another menu, leave Alt pressed
keySim.press(Qt::Key_Alt);
+ QTRY_VERIFY(!editMenuBarMenu->isVisible());
keySim.click(Qt::Key_H); // "&Help"
QVERIFY(!editMenuBarItem->isHighlighted());
QVERIFY(helpMenuBarItem->isHighlighted());