summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qsoftkeymanager.cpp
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2010-04-13 09:41:21 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2010-04-13 09:46:38 (GMT)
commit6433302cf96b64460cbcd770d8cb703f29a001ad (patch)
tree2e838343c8d7510bab5590467aaf8a6320184486 /src/gui/kernel/qsoftkeymanager.cpp
parentbe16b3def01783e693883c0990f73c815042b1e7 (diff)
downloadQt-6433302cf96b64460cbcd770d8cb703f29a001ad.zip
Qt-6433302cf96b64460cbcd770d8cb703f29a001ad.tar.gz
Qt-6433302cf96b64460cbcd770d8cb703f29a001ad.tar.bz2
Improve handling of QAction in soft key manager
It also reduces QActionPrivate by 16 bytes.
Diffstat (limited to 'src/gui/kernel/qsoftkeymanager.cpp')
-rw-r--r--src/gui/kernel/qsoftkeymanager.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp
index 23f1481..04e4685 100644
--- a/src/gui/kernel/qsoftkeymanager.cpp
+++ b/src/gui/kernel/qsoftkeymanager.cpp
@@ -43,7 +43,7 @@
#include "qevent.h"
#include "qbitmap.h"
#include "private/qsoftkeymanager_p.h"
-#include "private/qobject_p.h"
+#include "private/qaction_p.h"
#include "private/qsoftkeymanager_common_p.h"
#ifdef Q_WS_S60
@@ -104,7 +104,7 @@ QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *act
QAction::SoftKeyRole softKeyRole = QAction::NoSoftKey;
switch (standardKey) {
case MenuSoftKey: // FALL-THROUGH
- action->setProperty(MENU_ACTION_PROPERTY, QVariant(true)); // TODO: can be refactored away to use _q_action_menubar
+ QActionPrivate::get(action)->menuActionSoftkeys = true;
case OkSoftKey:
case SelectSoftKey:
case DoneSoftKey:
@@ -255,16 +255,12 @@ bool QSoftKeyManager::handleUpdateSoftKeys()
void QSoftKeyManager::setForceEnabledInSoftkeys(QAction *action)
{
- action->setProperty(FORCE_ENABLED_PROPERTY, QVariant(true));
+ QActionPrivate::get(action)->forceEnabledInSoftkeys = true;
}
bool QSoftKeyManager::isForceEnabledInSofkeys(QAction *action)
{
- bool ret = false;
- QVariant property = action->property(FORCE_ENABLED_PROPERTY);
- if (property.isValid() && property.toBool())
- ret = true;
- return ret;
+ return QActionPrivate::get(action)->forceEnabledInSoftkeys;
}
bool QSoftKeyManager::event(QEvent *e)