diff options
author | Markku Luukkainen <markku.luukkainen@digia.com> | 2009-06-06 17:37:37 (GMT) |
---|---|---|
committer | Markku Luukkainen <markku.luukkainen@digia.com> | 2009-06-06 17:37:37 (GMT) |
commit | ef0f6267822c782f0b555e15ddab24c41c51d2e8 (patch) | |
tree | 2638fa405a65e5b888b026f96584925fed7e3851 | |
parent | 9420db9284f20e28239d1c6e8a4cccf7707c014e (diff) | |
download | Qt-ef0f6267822c782f0b555e15ddab24c41c51d2e8.zip Qt-ef0f6267822c782f0b555e15ddab24c41c51d2e8.tar.gz Qt-ef0f6267822c782f0b555e15ddab24c41c51d2e8.tar.bz2 |
Added support for setting softkeys dynamically
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 6 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_s60.cpp | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 7a8b143..e82fbd2 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -11531,7 +11531,8 @@ void QWidget::setSoftKeys(QAction *softKey) d->softKeys.clear(); if (softKey) d->softKeys.append(softKey); -// d->setNativeSoftKeys(softkeys); + if (QApplication::focusWidget() == this) + d->setNativeSoftKeys(this->softKeys()); } void QWidget::setSoftKeys(const QList<QAction*> &softKeys) @@ -11542,7 +11543,8 @@ void QWidget::setSoftKeys(const QList<QAction*> &softKeys) for(int i = 0; i < softKeys.count(); i++) d->softKeys.append(softKeys.at(i)); - // d->setNativeSoftKeys(softkeys); + if (QApplication::focusWidget() == this) + d->setNativeSoftKeys(this->softKeys()); } /*! \fn const QX11Info &QWidget::x11Info() const diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 4e03206..cb2fc8f 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -107,7 +107,8 @@ static bool isSame(const QList<QAction*>& a, const QList<QAction*>& b) void QWidgetPrivate::setNativeSoftKeys(const QList<QAction*> &softkeys) { - if (QApplication::focusWidget()) { + Q_Q(QWidget); + if (QApplication::focusWidget() && q!=QApplication::focusWidget()) { QList<QAction *> old = QApplication::focusWidget()->softKeys(); if (isSame(old, softkeys )) return; |