summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qmenu.cpp
diff options
context:
space:
mode:
authorJanne Anttila <janne.anttila@digia.com>2010-03-23 08:36:22 (GMT)
committerJanne Anttila <janne.anttila@digia.com>2010-03-23 08:37:38 (GMT)
commit262e98f9a29385f99cd6f768632264e0b621dc01 (patch)
tree3c8d0745912d25d9ce0fcc5e72a4bf33a298c626 /src/gui/widgets/qmenu.cpp
parentae3d95f872c8bd2e192c58d7c7c830a3d2e4bc43 (diff)
downloadQt-262e98f9a29385f99cd6f768632264e0b621dc01.zip
Qt-262e98f9a29385f99cd6f768632264e0b621dc01.tar.gz
Qt-262e98f9a29385f99cd6f768632264e0b621dc01.tar.bz2
Fixed S60 softkey implementation to use popup/modal dialog softkeys.
Previously softkey implementation assumed that source for softkey actions is focused widget or activewindow if there is no focused widget. Since for example pop-up menu does not take focus immediately in touch enabled devices, the underlying widget softkeys were visible and usable when menu was open. This lead to problem that underlying widget could be interacted via softkeys when popup menu was open. For example as reported in QTBUG-8688, it was possible to close the underlying filedialog from which the currently active context menu was launched. It was also possible to open "Options" menu of underlying widget when context menu was open, leading to situation where several context menus could be launched via "Actions" item of "Options" menu. This was reported as an issue: QTBUG-6167 In addition when user started navigating in context menu via keypad, the menu got focus and softkeys changed to partially correct. Only partially correct, since context menu "Select" action and "Options" action had same priority and both associated to LSK. In addition the context menu action "Cancel" associated to RSK was set to invisible, meaning that it was also disabled and appeared in sofkeys as dimmed. All of these issues were fixed by making making the popup and modal dialogs highest priority softkey source. In case the focused widget is inside popup or modal dialog it is being used as an initial softkey source. In addition the softkeys created with QSoftKeyManager::createAction or QSoftKeyManager::createKeyedAction are now by default invisible i.e. not visible in context menu and have special property set to make them still normally enabled in softkeys. Task-number: QTBUG-6167 Task-number: QTBUG-8688 Task-number: QTBUG-9144 Reviewed-by: Sami Merila
Diffstat (limited to 'src/gui/widgets/qmenu.cpp')
-rw-r--r--src/gui/widgets/qmenu.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index 42b7406..a9978f9 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -168,8 +168,8 @@ void QMenuPrivate::init()
#ifdef QT_SOFTKEYS_ENABLED
selectAction = QSoftKeyManager::createKeyedAction(QSoftKeyManager::SelectSoftKey, Qt::Key_Select, q);
cancelAction = QSoftKeyManager::createKeyedAction(QSoftKeyManager::CancelSoftKey, Qt::Key_Back, q);
- selectAction->setVisible(false); // Don't show these in the menu
- cancelAction->setVisible(false);
+ selectAction->setPriority(QAction::HighPriority);
+ cancelAction->setPriority(QAction::HighPriority);
q->addAction(selectAction);
q->addAction(cancelAction);
#endif