diff options
author | Jani Hautakangas <ext-jani.hautakangas@nokia.com> | 2009-09-29 10:41:33 (GMT) |
---|---|---|
committer | Jani Hautakangas <ext-jani.hautakangas@nokia.com> | 2009-09-29 10:41:33 (GMT) |
commit | 9a7ca912ce72476bda57f2306b38e5f6e928fbf5 (patch) | |
tree | 31a3bf33c3fae37b53b17f3eaf4dcae90521df3c /tests/auto/qmenu | |
parent | 8aec69a5cae285174b41df6d268f007edcdec84b (diff) | |
download | Qt-9a7ca912ce72476bda57f2306b38e5f6e928fbf5.zip Qt-9a7ca912ce72476bda57f2306b38e5f6e928fbf5.tar.gz Qt-9a7ca912ce72476bda57f2306b38e5f6e928fbf5.tar.bz2 |
Softkey fixes to QMenu tests.
Softkeys add two extra "Select" and "Back" actions to menu by default.
First two actions in menu will be "Select" and "Back".
Reviewed-by: Janne Anttila
Diffstat (limited to 'tests/auto/qmenu')
-rw-r--r-- | tests/auto/qmenu/tst_qmenu.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp index e467229..726ca55 100644 --- a/tests/auto/qmenu/tst_qmenu.cpp +++ b/tests/auto/qmenu/tst_qmenu.cpp @@ -260,9 +260,17 @@ void tst_QMenu::onStatusMessageChanged(const QString &s) void tst_QMenu::addActionsAndClear() { - QCOMPARE(menus[0]->actions().count(), 0); +#ifdef QT_SOFTKEYS_ENABLED + // Softkeys add extra "Select" and "Back" actions to menu by default. + // Two first actions will be Select and Back when softkeys are enabled + int numSoftkeyActions = 2; +#else + int numSoftkeyActions = 0; +#endif + + QCOMPARE(menus[0]->actions().count(), 0 + numSoftkeyActions); createActions(); - QCOMPARE(menus[0]->actions().count(), 8); + QCOMPARE(menus[0]->actions().count(), 8 + numSoftkeyActions); menus[0]->clear(); QCOMPARE(menus[0]->actions().count(), 0); } |