summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorSami Merilä <sami.merila@nokia.com>2009-10-16 12:45:18 (GMT)
committerSami Merilä <sami.merila@nokia.com>2009-10-16 12:45:18 (GMT)
commit25f4ccc3a9de2e4610974540f88c331238218c72 (patch)
tree24a7234243ebbf823d641c8cfd36a939bc8ecffb /src/gui/kernel
parent93c7ab5a2b10481e4f10a6477379d8157ae5f7b0 (diff)
downloadQt-25f4ccc3a9de2e4610974540f88c331238218c72.zip
Qt-25f4ccc3a9de2e4610974540f88c331238218c72.tar.gz
Qt-25f4ccc3a9de2e4610974540f88c331238218c72.tar.bz2
Softkeys remain disabled if action owning action widget is enabled
Softkeys have a QAction that is related to some action widget. The initial state of the action was set according the state of action widget (enabled/disabled). Now, if action widget's state changes, the softkey's action remain in the initial state. This was fixed by removing the enable/disable from the QAction and instead use the real state of action widget when handling the command of softkey. Task-number: QTBUG-4619 Reviewed-by: Janne Anttila
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qsoftkeymanager.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp
index 1214f08..6116a5e 100644
--- a/src/gui/kernel/qsoftkeymanager.cpp
+++ b/src/gui/kernel/qsoftkeymanager.cpp
@@ -125,7 +125,6 @@ QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *act
break;
}
action->setSoftKeyRole(softKeyRole);
- action->setEnabled(actionWidget->isEnabled());
return action;
}
@@ -210,7 +209,7 @@ void QSoftKeyManagerPrivate::updateSoftKeys_sys(const QList<QAction*> &softkeys)
for (int index = 0; index < softkeys.count(); index++) {
const QAction* softKeyAction = softkeys.at(index);
switch (softKeyAction->softKeyRole()) {
- // Positive Actions go on LSK
+ // Positive Actions on the LSK
case QAction::PositiveSoftKey:
position = 0;
break;
@@ -253,7 +252,8 @@ bool QSoftKeyManager::handleCommand(int command)
QAction *action = softKeys.at(i);
if (action->softKeyRole() != QAction::NoSoftKey) {
if (j == index) {
- if (action->isEnabled()) {
+ QWidget *parent = action->parentWidget();
+ if (parent && parent->isEnabled()) {
action->activate(QAction::Trigger);
return true;
}