From 062e913e56a104f7d794cd4a7cecebbd33ead5a9 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Wed, 13 May 2009 19:27:24 +0200 Subject: QSoftKeyStack::handleSoftKeyPress(int command) will be called whenever a softkey is pressed. --- src/gui/widgets/qsoftkeystack.h | 2 ++ src/gui/widgets/qsoftkeystack_p.h | 5 +++++ src/gui/widgets/qsoftkeystack_s60.cpp | 9 +++++---- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/gui/widgets/qsoftkeystack.h b/src/gui/widgets/qsoftkeystack.h index 66edab0..ca06072 100644 --- a/src/gui/widgets/qsoftkeystack.h +++ b/src/gui/widgets/qsoftkeystack.h @@ -65,6 +65,8 @@ public: void push(const QList &softkeys); void pop(); + void handleSoftKeyPress(int command); + private: Q_DECLARE_PRIVATE(QSoftKeyStack) Q_DISABLE_COPY(QSoftKeyStack) diff --git a/src/gui/widgets/qsoftkeystack_p.h b/src/gui/widgets/qsoftkeystack_p.h index 1e8d0d1..77ae553 100644 --- a/src/gui/widgets/qsoftkeystack_p.h +++ b/src/gui/widgets/qsoftkeystack_p.h @@ -58,9 +58,14 @@ #include #include "qsoftkeyaction.h" +#include "qsoftkeystack.h" QT_BEGIN_NAMESPACE +// The following 2 defines may only be needed for s60. To be seen. +#define SOFTKEYSTART 5000 +#define SOFTKEYEND (5000 + Qt::Key_Context4) + #define QSoftkeySet QList class QSoftKeyStackPrivate : public QObjectPrivate diff --git a/src/gui/widgets/qsoftkeystack_s60.cpp b/src/gui/widgets/qsoftkeystack_s60.cpp index 35835f6..9e90fdf 100644 --- a/src/gui/widgets/qsoftkeystack_s60.cpp +++ b/src/gui/widgets/qsoftkeystack_s60.cpp @@ -49,9 +49,6 @@ #include "qsoftkeystack_p.h" -#define SOFTKEYSTART 5000 -#define SOFTKEYEND (5000 + Qt::Key_Context4) - void QSoftKeyStackPrivate::mapSoftKeys(const QSoftkeySet &top) { if (top.count() == 1) { @@ -100,4 +97,8 @@ void QSoftKeyStackPrivate::setNativeSoftKeys() } } - +void QSoftKeyStack::handleSoftKeyPress(int command) +{ + // Do the magic, here. + // Map the command back to actual softkey on the top of the stack and handle it +} -- cgit v0.12