summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qsoftkeymanager.cpp
diff options
context:
space:
mode:
authorTitta Heikkala <EXT-Titta.2.Heikkala@nokia.com>2011-03-30 12:41:24 +0300
committerSami Merila <sami.merila@nokia.com>2011-03-31 09:12:54 +0300
commitd75b10cf969c4d3b068d84bc650a76efcadc1012 (patch)
treea03cd8d4e754e5439eb2219145a3004bef4f7923 /src/gui/kernel/qsoftkeymanager.cpp
parent0b2446df2908a17496aadb70f403ba361cfc2142 (diff)
Support for new softkey in Symbian^3
QSoftKeyManager maps the StandardSoftKey values to Symbian commands. This way the softkeys are using Symbian defined icons. Task-number: QT-4620 Reviewed-by: Sami Merila
Diffstat (limited to 'src/gui/kernel/qsoftkeymanager.cpp')
-rw-r--r--src/gui/kernel/qsoftkeymanager.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp
index 1b2693385e..204efe9ee9 100644
--- a/src/gui/kernel/qsoftkeymanager.cpp
+++ b/src/gui/kernel/qsoftkeymanager.cpp
@@ -50,6 +50,10 @@
#include "private/qsoftkeymanager_s60_p.h"
#endif
+#ifdef SYMBIAN_VERSION_SYMBIAN3
+#include "private/qt_s60_p.h"
+#endif
+
#ifndef QT_NO_SOFTKEYMANAGER
QT_BEGIN_NAMESPACE
@@ -101,6 +105,30 @@ QSoftKeyManager::QSoftKeyManager() :
QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *actionWidget)
{
QAction *action = new QAction(standardSoftKeyText(standardKey), actionWidget);
+#ifdef SYMBIAN_VERSION_SYMBIAN3
+ int key = 0;
+ switch (standardKey) {
+ case OkSoftKey:
+ key = EAknSoftkeyOk;
+ break;
+ case SelectSoftKey:
+ key = EAknSoftkeySelect;
+ break;
+ case DoneSoftKey:
+ key = EAknSoftkeyDone;
+ break;
+ case MenuSoftKey:
+ key = EAknSoftkeyOptions;
+ break;
+ case CancelSoftKey:
+ key = EAknSoftkeyCancel;
+ break;
+ default:
+ break;
+ };
+ if (key != 0)
+ QSoftKeyManager::instance()->d_func()->softKeyCommandActions.insert(action, key);
+#endif
QAction::SoftKeyRole softKeyRole = QAction::NoSoftKey;
switch (standardKey) {
case MenuSoftKey: // FALL-THROUGH
@@ -143,6 +171,9 @@ void QSoftKeyManager::cleanupHash(QObject *obj)
Q_D(QSoftKeyManager);
QAction *action = qobject_cast<QAction*>(obj);
d->keyedActions.remove(action);
+#ifdef SYMBIAN_VERSION_SYMBIAN3
+ d->softKeyCommandActions.remove(action);
+#endif
}
void QSoftKeyManager::sendKeyEvent()