summaryrefslogtreecommitdiffstats
path: root/tests/auto/qmenu
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2010-03-02 15:27:46 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2010-03-03 09:52:11 (GMT)
commit60324267fbb8a8554e62aaf9ef01360709292320 (patch)
treea6463fa53ff7220414ca456909bf397fe059871d /tests/auto/qmenu
parent6e0565eaa293b84f7583947822fe5939cb47af89 (diff)
downloadQt-60324267fbb8a8554e62aaf9ef01360709292320.zip
Qt-60324267fbb8a8554e62aaf9ef01360709292320.tar.gz
Qt-60324267fbb8a8554e62aaf9ef01360709292320.tar.bz2
Make the sub-menu accessible via its shortcut even if it is the current
Task-number: QTBUG-7411 Reviewed-by: ogoffart
Diffstat (limited to 'tests/auto/qmenu')
-rw-r--r--tests/auto/qmenu/tst_qmenu.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp
index 3559b15..e10d7ee 100644
--- a/tests/auto/qmenu/tst_qmenu.cpp
+++ b/tests/auto/qmenu/tst_qmenu.cpp
@@ -105,6 +105,7 @@ private slots:
void deleteActionInTriggered();
void pushButtonPopulateOnAboutToShow();
void QTBUG7907_submenus_autoselect();
+ void QTBUG7411_submenus_activate();
protected slots:
void onActivated(QAction*);
void onHighlighted(QAction*);
@@ -948,6 +949,25 @@ void tst_QMenu::QTBUG7907_submenus_autoselect()
QVERIFY(!subset.isVisible());
}
+void tst_QMenu::QTBUG7411_submenus_activate()
+{
+ QMenu menu("Test Menu");
+ QAction *act = menu.addAction("foo");
+ QMenu sub1("&sub1");
+ sub1.addAction("foo");
+ sub1.setTitle("&sub1");
+ QAction *act1 = menu.addMenu(&sub1);
+ menu.show();
+ QTest::qWaitForWindowShown(&menu);
+ menu.setActiveAction(act);
+ QTest::keyPress(&menu, Qt::Key_Down);
+ QCOMPARE(menu.activeAction(), act1);
+ QVERIFY(!sub1.isVisible());
+ QTest::keyPress(&menu, Qt::Key_S);
+ QTRY_VERIFY(sub1.isVisible());
+}
+
+
QTEST_MAIN(tst_QMenu)
#include "tst_qmenu.moc"