summaryrefslogtreecommitdiffstats
path: root/tools/designer/src/lib/shared/qdesigner_menubar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/designer/src/lib/shared/qdesigner_menubar.cpp')
-rw-r--r--tools/designer/src/lib/shared/qdesigner_menubar.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/designer/src/lib/shared/qdesigner_menubar.cpp b/tools/designer/src/lib/shared/qdesigner_menubar.cpp
index 80c7b53..e25290a 100644
--- a/tools/designer/src/lib/shared/qdesigner_menubar.cpp
+++ b/tools/designer/src/lib/shared/qdesigner_menubar.cpp
@@ -867,7 +867,15 @@ void QDesignerMenuBar::showMenu(int index)
if ((menu->windowFlags() & Qt::Popup) != Qt::Popup)
menu->setWindowFlags(Qt::Popup);
menu->adjustSize();
- menu->move(mapToGlobal(g.bottomLeft()));
+ if (layoutDirection() == Qt::LeftToRight) {
+ menu->move(mapToGlobal(g.bottomLeft()));
+ } else {
+ // The position is not initially correct due to the unknown width,
+ // causing it to overlap a bit the first time it is invoked.
+ const QSize menuSize = menu->size();
+ QPoint point = g.bottomRight() - QPoint(menu->width(), 0);
+ menu->move(mapToGlobal(point));
+ }
menu->setFocus(Qt::MouseFocusReason);
menu->raise();
menu->show();