summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qdialogbuttonbox.cpp
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 /src/gui/widgets/qdialogbuttonbox.cpp
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 'src/gui/widgets/qdialogbuttonbox.cpp')
-rw-r--r--src/gui/widgets/qdialogbuttonbox.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/gui/widgets/qdialogbuttonbox.cpp b/src/gui/widgets/qdialogbuttonbox.cpp
index cc74a53..732dbc9 100644
--- a/src/gui/widgets/qdialogbuttonbox.cpp
+++ b/src/gui/widgets/qdialogbuttonbox.cpp
@@ -258,6 +258,7 @@ static const int layouts[2][5][14] =
}
};
+#if defined(QT_SOFTKEYS_ENABLED) && !defined(QT_NO_ACTION)
class QDialogButtonEnabledProxy : public QObject
{
public:
@@ -281,7 +282,7 @@ private:
QWidget *source;
QAction *target;
};
-
+#endif
class QDialogButtonBoxPrivate : public QWidgetPrivate
{
@@ -314,7 +315,7 @@ public:
void addButtonsToLayout(const QList<QAbstractButton *> &buttonList, bool reverse);
void retranslateStrings();
const char *standardButtonText(QDialogButtonBox::StandardButton sbutton) const;
-#ifdef QT_SOFTKEYS_ENABLED
+#if defined(QT_SOFTKEYS_ENABLED) && !defined(QT_NO_ACTION)
QAction *createSoftKey(QAbstractButton *button, QDialogButtonBox::ButtonRole role);
#endif
};
@@ -571,7 +572,7 @@ void QDialogButtonBoxPrivate::addButton(QAbstractButton *button, QDialogButtonBo
QObject::connect(button, SIGNAL(clicked()), q, SLOT(_q_handleButtonClicked()));
QObject::connect(button, SIGNAL(destroyed()), q, SLOT(_q_handleButtonDestroyed()));
buttonLists[role].append(button);
-#ifdef QT_SOFTKEYS_ENABLED
+#if defined(QT_SOFTKEYS_ENABLED) && !defined(QT_NO_ACTION)
QAction *action = createSoftKey(button, role);
softKeyActions.insert(button, action);
new QDialogButtonEnabledProxy(action, button, action);
@@ -580,7 +581,7 @@ void QDialogButtonBoxPrivate::addButton(QAbstractButton *button, QDialogButtonBo
layoutButtons();
}
-#ifdef QT_SOFTKEYS_ENABLED
+#if defined(QT_SOFTKEYS_ENABLED) && !defined(QT_NO_ACTION)
QAction* QDialogButtonBoxPrivate::createSoftKey(QAbstractButton *button, QDialogButtonBox::ButtonRole role)
{
Q_Q(QDialogButtonBox);
@@ -718,7 +719,7 @@ void QDialogButtonBoxPrivate::retranslateStrings()
if (buttonText) {
QPushButton *button = it.key();
button->setText(QDialogButtonBox::tr(buttonText));
-#ifdef QT_SOFTKEYS_ENABLED
+#if defined(QT_SOFTKEYS_ENABLED) && !defined(QT_NO_ACTION)
QAction *action = softKeyActions.value(button, 0);
if (action)
action->setText(button->text());
@@ -997,7 +998,7 @@ void QDialogButtonBox::removeButton(QAbstractButton *button)
}
}
}
-#ifdef QT_SOFTKEYS_ENABLED
+#if defined(QT_SOFTKEYS_ENABLED) && !defined(QT_NO_ACTION)
QAction *action = d->softKeyActions.value(button, 0);
if (action) {
d->softKeyActions.remove(button);
@@ -1243,7 +1244,7 @@ bool QDialogButtonBox::event(QEvent *event)
}else if (event->type() == QEvent::LanguageChange) {
d->retranslateStrings();
}
-#ifdef QT_SOFTKEYS_ENABLED
+#if defined(QT_SOFTKEYS_ENABLED) && !defined(QT_NO_ACTION)
else if (event->type() == QEvent::ParentChange) {
QWidget *dialog = 0;
QWidget *p = this;