diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2012-12-11 12:47:26 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-12-19 13:33:17 (GMT) |
commit | 0a24cec5a11678ebefe08b331812adbb9b3368aa (patch) | |
tree | 15c0161167424190cb42d89ebdc899733f159835 /src/gui/widgets | |
parent | 99288633373ecc8ba808cf0ecf18f4a81d62ac84 (diff) | |
download | Qt-0a24cec5a11678ebefe08b331812adbb9b3368aa.zip Qt-0a24cec5a11678ebefe08b331812adbb9b3368aa.tar.gz Qt-0a24cec5a11678ebefe08b331812adbb9b3368aa.tar.bz2 |
QMenu: Do not set snapToMouse if a caused-widget exists.
When clicking at the bottom-right corner of a menu in a menu
bar, it appears at the wrong position. Add test and stabilize
RTL-tests by making sure the layout direction is cleared should
they fail.
Task-number: QTBUG-28031
Task-number: QTBUG-2596
Change-Id: Ibc5ae916388753908e9f3ee98e8859faaa0c8723
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
(cherry picked from qtbase/bf178c77dda1db56ae698c1d31a6e3f685f4830f)
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qmenu.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 77b6b21..d829465 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -1922,7 +1922,7 @@ void QMenu::popup(const QPoint &p, QAction *atAction) QPoint mouse = QCursor::pos(); d->mousePopupPos = mouse; - const bool snapToMouse = (QRect(p.x() - 3, p.y() - 3, 6, 6).contains(mouse)); + const bool snapToMouse = !d->causedPopup.widget && (QRect(p.x() - 3, p.y() - 3, 6, 6).contains(mouse)); const QSize menuSize(sizeHint()); if (adjustToDesktop) { |