diff options
author | Leonard Lee <leonard.lee@digia.com> | 2013-06-17 08:47:06 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-06-17 12:00:42 (GMT) |
commit | b20cb63f457930651cf7aa9108df5432e25dcc46 (patch) | |
tree | 531fb1ca44f18236508bff3b8661f1b9813a445d /src/gui/widgets | |
parent | a9a468e0967448f6dcfd85264afa18d68e9e0c23 (diff) | |
download | Qt-b20cb63f457930651cf7aa9108df5432e25dcc46.zip Qt-b20cb63f457930651cf7aa9108df5432e25dcc46.tar.gz Qt-b20cb63f457930651cf7aa9108df5432e25dcc46.tar.bz2 |
Recognize separator item in QMenu.
The mouse over event on upper level menu separator should
automatically close the sub menu listing. Manual test is not
needed for this commit since it is easy to test it against common
examples.
Task-number: QTBUG-31664
Change-Id: I6632d0bce27ca064ddfdd05743df969b3e6e02ee
(cherry-picked from qtbase/f730cd7542548d7d5fb7cd25f631e471697960c8)
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qmenu.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 400fd30..db3d7cd 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -2863,9 +2863,9 @@ void QMenu::mouseMoveEvent(QMouseEvent *e) d->hasHadMouse = d->hasHadMouse || rect().contains(e->pos()); QAction *action = d->actionAt(e->pos()); - if (!action) { + if (!action || action->isSeparator()) { if (d->hasHadMouse - && (!d->currentAction + && (!d->currentAction || (action && action->isSeparator()) || !(d->currentAction->menu() && d->currentAction->menu()->isVisible()))) d->setCurrentAction(0); return; |