diff options
Diffstat (limited to 'tests/auto/qmenu')
-rw-r--r-- | tests/auto/qmenu/tst_qmenu.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp index ab8dd48..4a4231a 100644 --- a/tests/auto/qmenu/tst_qmenu.cpp +++ b/tests/auto/qmenu/tst_qmenu.cpp @@ -55,6 +55,9 @@ #include <qmenu.h> #include <qstyle.h> #include <qdebug.h> + +#include "../../shared/util.h" + //TESTED_CLASS= //TESTED_FILES= @@ -437,15 +440,16 @@ void tst_QMenu::overrideMenuAction() m->addAction(aQuit); w.show(); - QTest::qWait(200); + w.setFocus(); + QTRY_VERIFY(w.hasFocus()); //test of the action inside the menu QTest::keyClick(&w, Qt::Key_X, Qt::ControlModifier); - QCOMPARE(activated, aQuit); + QTRY_COMPARE(activated, aQuit); //test if the menu still pops out QTest::keyClick(&w, Qt::Key_F, Qt::AltModifier); - QVERIFY(m->isVisible()); + QTRY_VERIFY(m->isVisible()); delete aFileMenu; @@ -703,12 +707,12 @@ void tst_QMenu::task250673_activeMultiColumnSubMenuPosition() }; QMenu sub; - + if (sub.style()->styleHint(QStyle::SH_Menu_Scrollable, 0, &sub)) { //the style prevents the menus from getting columns QSKIP("the style doesn't support multiple columns, it makes the menu scrollable", SkipSingle); } - + sub.addAction("Sub-Item1"); QAction *subAction = sub.addAction("Sub-Item2"); |