summaryrefslogtreecommitdiffstats
path: root/tests/auto/qdialogbuttonbox
diff options
context:
space:
mode:
authorTasuku Suzuki <tasuku.suzuki@nokia.com>2010-04-12 11:30:04 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2010-04-12 11:30:04 (GMT)
commitc4c8f9cbad91222364f5262753c6d0dbb931a57a (patch)
tree0b24aa242c8795e3c446e1c30fdaa79d55958747 /tests/auto/qdialogbuttonbox
parent787f713f87b365d8385af97073540c7ee565fde0 (diff)
downloadQt-c4c8f9cbad91222364f5262753c6d0dbb931a57a.zip
Qt-c4c8f9cbad91222364f5262753c6d0dbb931a57a.tar.gz
Qt-c4c8f9cbad91222364f5262753c6d0dbb931a57a.tar.bz2
Fix compile error with QT_NO_ACTION in QtGui
Merge-request: 2321 Reviewed-by: Thierry Bastian <thierry.bastian@nokia.com>
Diffstat (limited to 'tests/auto/qdialogbuttonbox')
-rw-r--r--tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp b/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp
index bf4ea5f..195f8b6 100644
--- a/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp
+++ b/tests/auto/qdialogbuttonbox/tst_qdialogbuttonbox.cpp
@@ -721,11 +721,13 @@ void tst_QDialogButtonBox::testDefaultButton_data()
static int softKeyCount(QWidget *widget)
{
int softkeyCount = 0;
+#ifndef QT_NO_ACTION
QList<QAction *> actions = widget->actions();
foreach (QAction *action, actions) {
if (action->softKeyRole() != QAction::NoSoftKey)
softkeyCount++;
}
+#endif
return softkeyCount;
}
@@ -737,14 +739,18 @@ void tst_QDialogButtonBox::testS60SoftKeys()
buttonBox.setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
dialog.show();
+#ifndef QT_NO_ACTION
QCOMPARE( softKeyCount(&dialog), 2);
+#endif
QDialog dialog2(0);
QDialogButtonBox buttonBox2(&dialog2);
buttonBox2.setStandardButtons(QDialogButtonBox::Cancel);
dialog2.show();
+#ifndef QT_NO_ACTION
QCOMPARE( softKeyCount(&dialog2), 1);
+#endif
#else
QSKIP("S60-specific test", SkipAll );
@@ -759,21 +765,27 @@ void tst_QDialogButtonBox::testSoftKeyReparenting()
buttonBox->addButton(QDialogButtonBox::Ok);
buttonBox->addButton(QDialogButtonBox::Cancel);
+#ifndef QT_NO_ACTION
QCOMPARE(softKeyCount(&dialog), 0);
QCOMPARE(softKeyCount(buttonBox), 2);
+#endif
// Were the softkeys re-parented correctly?
dialog.setLayout(new QVBoxLayout);
dialog.layout()->addWidget(buttonBox);
+#ifndef QT_NO_ACTION
QCOMPARE(softKeyCount(&dialog), 2);
QCOMPARE(softKeyCount(buttonBox), 0);
+#endif
// Softkeys are only added to QDialog, not QWidget
QWidget *nested = new QWidget;
nested->setLayout(new QVBoxLayout);
nested->layout()->addWidget(buttonBox);
+#ifndef QT_NO_ACTION
QCOMPARE(softKeyCount(nested), 0);
QCOMPARE(softKeyCount(buttonBox), 2);
+#endif
}
#endif