summaryrefslogtreecommitdiffstats
path: root/tests/auto/qactiongroup
diff options
context:
space:
mode:
authorJani Hautakangas <ext-jani.hautakangas@nokia.com>2009-09-29 10:41:33 (GMT)
committerJani Hautakangas <ext-jani.hautakangas@nokia.com>2009-09-29 10:41:33 (GMT)
commit9a7ca912ce72476bda57f2306b38e5f6e928fbf5 (patch)
tree31a3bf33c3fae37b53b17f3eaf4dcae90521df3c /tests/auto/qactiongroup
parent8aec69a5cae285174b41df6d268f007edcdec84b (diff)
downloadQt-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/qactiongroup')
-rw-r--r--tests/auto/qactiongroup/tst_qactiongroup.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/auto/qactiongroup/tst_qactiongroup.cpp b/tests/auto/qactiongroup/tst_qactiongroup.cpp
index c290941..2d215a0 100644
--- a/tests/auto/qactiongroup/tst_qactiongroup.cpp
+++ b/tests/auto/qactiongroup/tst_qactiongroup.cpp
@@ -226,6 +226,14 @@ void tst_QActionGroup::separators()
mw.show();
+#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
+
QAction *action = new QAction(&actGroup);
action->setText("test one");
@@ -237,13 +245,13 @@ void tst_QActionGroup::separators()
while (it.hasNext())
menu.addAction(it.next());
- QCOMPARE((int)menu.actions().size(), 2);
+ QCOMPARE((int)menu.actions().size(), 2 + numSoftkeyActions);
it = QListIterator<QAction*>(actGroup.actions());
while (it.hasNext())
menu.removeAction(it.next());
- QCOMPARE((int)menu.actions().size(), 0);
+ QCOMPARE((int)menu.actions().size(), 0 + numSoftkeyActions);
action = new QAction(&actGroup);
action->setText("test two");
@@ -252,7 +260,7 @@ void tst_QActionGroup::separators()
while (it.hasNext())
menu.addAction(it.next());
- QCOMPARE((int)menu.actions().size(), 3);
+ QCOMPARE((int)menu.actions().size(), 3 + numSoftkeyActions);
}
void tst_QActionGroup::testActionInTwoQActionGroup()