summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/widgets/widgets/qmenu.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index 75704f73de..2cafe462b1 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -2323,16 +2323,7 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
ensurePolished(); // Get the right font
emit aboutToShow();
const bool actionListChanged = d->itemsDirty;
- d->updateActionRects();
- QPoint pos;
- QPushButton *causedButton = qobject_cast<QPushButton*>(d->causedPopup.widget);
- if (actionListChanged && causedButton)
- pos = QPushButtonPrivate::get(causedButton)->adjustedMenuPosition();
- else
- pos = p;
- const QSize menuSizeHint(sizeHint());
- QSize size = menuSizeHint;
QRect screen;
#ifndef QT_NO_GRAPHICSVIEW
bool isEmbedded = !bypassGraphicsProxyWidget(this) && d->nearestGraphicsProxyWidget(this);
@@ -2341,6 +2332,17 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
else
#endif
screen = d->popupGeometry(QApplication::desktop()->screenNumber(p));
+ d->updateActionRects(screen);
+
+ QPoint pos;
+ QPushButton *causedButton = qobject_cast<QPushButton*>(d->causedPopup.widget);
+ if (actionListChanged && causedButton)
+ pos = QPushButtonPrivate::get(causedButton)->adjustedMenuPosition();
+ else
+ pos = p;
+
+ const QSize menuSizeHint(sizeHint());
+ QSize size = menuSizeHint;
const int desktopFrame = style()->pixelMetric(QStyle::PM_MenuDesktopFrameWidth, 0, this);
bool adjustToDesktop = !window()->testAttribute(Qt::WA_DontShowOnScreen);