summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-12-07 12:40:00 (GMT)
committeraxis <qt-info@nokia.com>2009-12-07 12:40:00 (GMT)
commit757fc27dcdaf67b2f79d2f3bcc8eaaeff345c0c8 (patch)
tree06c36fb43ab2e5711136e64528972800afa6c2b7 /src/gui/widgets
parentcfd98763a1d051238382b77975567da0c0562ade (diff)
parent245c9cc07ff1581dd126f213985c3557b2667aca (diff)
downloadQt-757fc27dcdaf67b2f79d2f3bcc8eaaeff345c0c8.zip
Qt-757fc27dcdaf67b2f79d2f3bcc8eaaeff345c0c8.tar.gz
Qt-757fc27dcdaf67b2f79d2f3bcc8eaaeff345c0c8.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6-staging2
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qdialogbuttonbox.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/gui/widgets/qdialogbuttonbox.cpp b/src/gui/widgets/qdialogbuttonbox.cpp
index 0e859f1..56cf545 100644
--- a/src/gui/widgets/qdialogbuttonbox.cpp
+++ b/src/gui/widgets/qdialogbuttonbox.cpp
@@ -259,6 +259,30 @@ static const int layouts[2][5][14] =
}
};
+class QDialogButtonEnabledProxy : public QObject
+{
+public:
+ QDialogButtonEnabledProxy(QObject *parent, QWidget *src, QAction *trg) : QObject(parent), source(src), target(trg)
+ {
+ source->installEventFilter(this);
+ }
+ ~QDialogButtonEnabledProxy()
+ {
+ source->removeEventFilter(this);
+ }
+ bool eventFilter(QObject *object, QEvent *event)
+ {
+ if (object == source && event->type() == QEvent::EnabledChange) {
+ target->setEnabled(source->isEnabled());
+ }
+ return false;
+ };
+private:
+ QWidget *source;
+ QAction *target;
+};
+
+
class QDialogButtonBoxPrivate : public QWidgetPrivate
{
Q_DECLARE_PUBLIC(QDialogButtonBox)
@@ -548,7 +572,9 @@ void QDialogButtonBoxPrivate::addButton(QAbstractButton *button, QDialogButtonBo
QObject::connect(button, SIGNAL(destroyed()), q, SLOT(_q_handleButtonDestroyed()));
buttonLists[role].append(button);
#ifdef QT_SOFTKEYS_ENABLED
- softKeyActions.insert(button, createSoftKey(button, role));
+ QAction *action = createSoftKey(button, role);
+ softKeyActions.insert(button, action);
+ new QDialogButtonEnabledProxy(action, button, action);
#endif
if (doLayout)
layoutButtons();