diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2013-01-10 20:43:22 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-14 20:45:32 (GMT) |
commit | 6db96677ab9e1b3d717e3704a658e528b457b255 (patch) | |
tree | 11057a6d95da3851d41716c3d4dded6719831310 /tests/auto | |
parent | 2e97dd401a09e4a9027dea885db7fd95e961a0c5 (diff) | |
download | Qt-6db96677ab9e1b3d717e3704a658e528b457b255.zip Qt-6db96677ab9e1b3d717e3704a658e528b457b255.tar.gz Qt-6db96677ab9e1b3d717e3704a658e528b457b255.tar.bz2 |
QMenu: Fix nested popup when keyboard shortcut is used
Task-number: QTBUG-20403
Change-Id: I2a5fe00dd16e9dc1ec0d742a8f48083fc2954996
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
(cherry picked from qtbase/b6963f109ad54c6f03b3391d57db9a536d49ba7d)
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qmenu/tst_qmenu.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp index 0b513b8..16e6f00 100644 --- a/tests/auto/qmenu/tst_qmenu.cpp +++ b/tests/auto/qmenu/tst_qmenu.cpp @@ -111,6 +111,7 @@ private slots: void pushButtonPopulateOnAboutToShow(); void QTBUG7907_submenus_autoselect(); void QTBUG7411_submenus_activate(); + void QTBUG20403_nested_popup_on_shortcut_trigger(); void QTBUG_10735_crashWithDialog(); void QTBUG_25544_macMenuState(); void QTBUG_25544_macMenuActionState(); @@ -983,6 +984,22 @@ void tst_QMenu::QTBUG7411_submenus_activate() QTRY_VERIFY(sub1.isVisible()); } +void tst_QMenu::QTBUG20403_nested_popup_on_shortcut_trigger() +{ + QMenu menu("Test Menu"); + QMenu sub1("&sub1"); + QMenu subsub1("&subsub1"); + subsub1.addAction("foo"); + sub1.addMenu(&subsub1); + menu.addMenu(&sub1); + menu.show(); + QVERIFY(QTest::qWaitForWindowShown(&menu)); + QTest::keyPress(&menu, Qt::Key_S); + QTest::qWait(100); // 20ms delay with previous behavior + QTRY_VERIFY(sub1.isVisible()); + QVERIFY(!subsub1.isVisible()); +} + class MyMenu : public QMenu { Q_OBJECT |