diff options
Diffstat (limited to 'tests/auto/widgets/widgets/qmenu')
-rw-r--r-- | tests/auto/widgets/widgets/qmenu/CMakeLists.txt | 30 | ||||
-rw-r--r-- | tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp | 9 |
2 files changed, 36 insertions, 3 deletions
diff --git a/tests/auto/widgets/widgets/qmenu/CMakeLists.txt b/tests/auto/widgets/widgets/qmenu/CMakeLists.txt new file mode 100644 index 0000000000..a20fe70492 --- /dev/null +++ b/tests/auto/widgets/widgets/qmenu/CMakeLists.txt @@ -0,0 +1,30 @@ +# Generated from qmenu.pro. + +##################################################################### +## tst_qmenu Test: +##################################################################### + +add_qt_test(tst_qmenu + SOURCES + tst_qmenu.cpp + PUBLIC_LIBRARIES + Qt::Gui + Qt::GuiPrivate + Qt::TestPrivate + Qt::Widgets +) + +## Scopes: +##################################################################### + +extend_target(tst_qmenu CONDITION APPLE_OSX + SOURCES + tst_qmenu_mac.mm + PUBLIC_LIBRARIES + objc +) + +extend_target(tst_qmenu CONDITION NOT APPLE_OSX + DEFINES + QTEST_QPA_MOUSE_HANDLING +) diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp index 7e39138473..a89b3231ad 100644 --- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp +++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp @@ -484,7 +484,7 @@ void tst_QMenu::overrideMenuAction() // On Mac and Windows CE, we need to create native key events to test menu // action activation, so skip this part of the test. -#if !defined(Q_OS_DARWIN) +#if QT_CONFIG(shortcut) && !defined(Q_OS_DARWIN) QAction *aQuit = new QAction("Quit", &w); aQuit->setShortcut(QKeySequence("Ctrl+X")); m->addAction(aQuit); @@ -502,7 +502,7 @@ void tst_QMenu::overrideMenuAction() //test if the menu still pops out QTest::keyClick(&w, Qt::Key_F, Qt::AltModifier); QTRY_VERIFY(m->isVisible()); -#endif +#endif // QT_CONFIG(shortcut) && !Q_OS_DARWIN delete aFileMenu; @@ -1845,10 +1845,13 @@ void tst_QMenu::QTBUG_61039_menu_shortcuts() QSKIP("Window activation is not supported"); QAction *actionKamen = new QAction("Action Kamen"); +#if QT_CONFIG(shortcut) actionKamen->setShortcut(QKeySequence(QLatin1String("K"))); - +#endif QAction *actionJoe = new QAction("Action Joe"); +#if QT_CONFIG(shortcut) actionJoe->setShortcut(QKeySequence(QLatin1String("Ctrl+J"))); +#endif QMenu menu; menu.addAction(actionKamen); |