diff options
-rw-r--r-- | tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp b/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp index e8fc1f3..936ebf7 100644 --- a/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp +++ b/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp @@ -43,6 +43,7 @@ #include <QtGui/QStyle> #include <QtGui/QLayout> #include <QtGui/QDialog> +#include <QtGui/QAction> #include <qdialogbuttonbox.h> #include <limits.h> @@ -721,15 +722,28 @@ void tst_QDialogButtonBox::testS60SoftKeys() QDialogButtonBox buttonBox(&dialog); buttonBox.setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); dialog.show(); - QList<QAction*> softKeys = dialog.softKeys(); - QCOMPARE( softKeys.count(), 2); + + int softkeyCount = 0; + QList<QAction *> actions = dialog.actions(); + foreach (QAction *action, actions) { + if (action->softKeyRole() != QAction::NoSoftKey) + softkeyCount++; + } + QCOMPARE( softkeyCount, 2); QDialog dialog2(0); QDialogButtonBox buttonBox2(&dialog2); buttonBox2.setStandardButtons(QDialogButtonBox::Cancel); dialog2.show(); - softKeys = dialog2.softKeys(); - QCOMPARE( softKeys.count(), 1); + + int softkeyCount2 = 0; + QList<QAction *> actions2 = dialog2.actions(); + foreach (QAction *action, actions2) { + if (action->softKeyRole() != QAction::NoSoftKey) + softkeyCount2++; + } + QCOMPARE( softkeyCount2, 1); + #else QSKIP("S60-specific test", SkipAll ); #endif |