summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qsoftkeymanager.cpp
diff options
context:
space:
mode:
authorGareth Stockwell <ext-gareth.stockwell@nokia.com>2009-11-03 13:42:29 (GMT)
committerGareth Stockwell <ext-gareth.stockwell@nokia.com>2009-11-03 13:42:29 (GMT)
commit63f2cc8d9526d3fd8a64e62be2a469bf0eee54f0 (patch)
tree7e6724964ceb6e38f478074780f06df0bdd11dbd /src/gui/kernel/qsoftkeymanager.cpp
parent6a89291da7e1322ad81c4939cc9d69db01957a4c (diff)
parentdc89c842779f87ce69882ba54fa8d5bb79e0edbd (diff)
downloadQt-63f2cc8d9526d3fd8a64e62be2a469bf0eee54f0.zip
Qt-63f2cc8d9526d3fd8a64e62be2a469bf0eee54f0.tar.gz
Qt-63f2cc8d9526d3fd8a64e62be2a469bf0eee54f0.tar.bz2
Merge branch '4.6' into mmfphonon
Diffstat (limited to 'src/gui/kernel/qsoftkeymanager.cpp')
-rw-r--r--src/gui/kernel/qsoftkeymanager.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp
index 8612e64..26f0a39 100644
--- a/src/gui/kernel/qsoftkeymanager.cpp
+++ b/src/gui/kernel/qsoftkeymanager.cpp
@@ -48,6 +48,7 @@
#include "private/qsoftkeymanager_p.h"
#include "private/qobject_p.h"
+#ifndef QT_NO_SOFTKEYMANAGER
QT_BEGIN_NAMESPACE
#ifdef Q_WS_S60
@@ -139,11 +140,18 @@ QAction *QSoftKeyManager::createKeyedAction(StandardSoftKey standardKey, Qt::Key
QScopedPointer<QAction> action(createAction(standardKey, actionWidget));
connect(action.data(), SIGNAL(triggered()), QSoftKeyManager::instance(), SLOT(sendKeyEvent()));
-
+ connect(action.data(), SIGNAL(destroyed(QObject*)), QSoftKeyManager::instance(), SLOT(cleanupHash(QObject*)));
QSoftKeyManager::instance()->d_func()->keyedActions.insert(action.data(), key);
return action.take();
}
+void QSoftKeyManager::cleanupHash(QObject* obj)
+{
+ Q_D(QSoftKeyManager);
+ QAction *action = qobject_cast<QAction*>(obj);
+ d->keyedActions.remove(action);
+}
+
void QSoftKeyManager::sendKeyEvent()
{
Q_D(QSoftKeyManager);
@@ -189,7 +197,8 @@ bool QSoftKeyManager::event(QEvent *e)
} while (source);
QSoftKeyManagerPrivate::softKeySource = source;
- QSoftKeyManagerPrivate::updateSoftKeys_sys(softKeys);
+ if (source)
+ QSoftKeyManagerPrivate::updateSoftKeys_sys(softKeys);
return true;
}
return false;
@@ -199,6 +208,7 @@ bool QSoftKeyManager::event(QEvent *e)
void QSoftKeyManagerPrivate::updateSoftKeys_sys(const QList<QAction*> &softkeys)
{
CEikButtonGroupContainer* nativeContainer = S60->buttonGroupContainer();
+ nativeContainer->DrawableWindow()->SetOrdinalPosition(0);
nativeContainer->DrawableWindow()->SetPointerCapturePriority(1); //keep softkeys available in modal dialog
QT_TRAP_THROWING(nativeContainer->SetCommandSetL(R_AVKON_SOFTKEYS_EMPTY_WITH_IDS));
@@ -279,4 +289,4 @@ void QSoftKeyManagerPrivate::updateSoftKeys_sys(const QList<QAction*> &)
#endif
QT_END_NAMESPACE
-
+#endif //QT_NO_SOFTKEYMANAGER