summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-06-03 13:59:18 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-06-03 14:00:59 (GMT)
commita04e1c4733feb643eb8da7b4a94c175153691b38 (patch)
treeb1af4008bac74911020d626d59eda43335aaada2
parentbd14a25c84fc2c12bfaa594b338aa2d0c0d4d940 (diff)
downloadQt-a04e1c4733feb643eb8da7b4a94c175153691b38.zip
Qt-a04e1c4733feb643eb8da7b4a94c175153691b38.tar.gz
Qt-a04e1c4733feb643eb8da7b4a94c175153691b38.tar.bz2
Fixed the QMenu to open submenus even if the pointing device is moving
but the current highlighted item doesn't change Task-number: 254238 Reviewed-by: ogoffart
-rw-r--r--src/gui/widgets/qmenu.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp
index bcfe0fb..711f1f4 100644
--- a/src/gui/widgets/qmenu.cpp
+++ b/src/gui/widgets/qmenu.cpp
@@ -547,10 +547,12 @@ void QMenuPrivate::setCurrentAction(QAction *action, int popup, SelectionReason
{
Q_Q(QMenu);
tearoffHighlighted = 0;
- if (action == currentAction && !(action && action->menu() && action->menu() != activeMenu)) {
- if(QMenu *menu = qobject_cast<QMenu*>(causedPopup.widget)) {
- if(causedPopup.action && menu->d_func()->activeMenu == q)
- menu->d_func()->setCurrentAction(causedPopup.action, 0, reason, false);
+ if (action == currentAction) {
+ if (!action || !action->menu() || action->menu() == activeMenu) {
+ if(QMenu *menu = qobject_cast<QMenu*>(causedPopup.widget)) {
+ if(causedPopup.action && menu->d_func()->activeMenu == q)
+ menu->d_func()->setCurrentAction(causedPopup.action, 0, reason, false);
+ }
}
return;
}
@@ -565,7 +567,7 @@ void QMenuPrivate::setCurrentAction(QAction *action, int popup, SelectionReason
QAction *previousAction = currentAction;
#endif
#ifdef QT3_SUPPORT
- emitHighlighted = (action && action != currentAction);
+ emitHighlighted = action;
#endif
currentAction = action;
if (action) {