path: root/src
diff options
authorMartin Gräßlin <>2014-04-28 09:42:10 +0200
committerThe Qt Project <>2014-05-09 12:16:05 +0200
commitdf3720527dddad4c04ad1a6b7c07f4bd66495053 (patch)
tree64b9f986c5c61e1f1f24bc0a141fedb6db1bb182 /src
parente0e86d5651cc8b430b381f1278c917e51671d23e (diff)
Ensure the QMenu is polished before creating the native window
Call ::ensurePolished from QMenu::exec before the native window gets created. This ensures that the style handles the menu before its too late. E.g. a style which wants to create RGBA menus needs to add the appropriate flag before the native window gets created. Without this change the style cannot change to RGBA as the native window has already been created and changing the format used by QWindow is not possible after QWindow::create was called. Change-Id: Ic861037a438b4cb74c59a00be0ef2d633db538ed Reviewed-by: Friedemann Kleint <> Reviewed-by: Gabriel de Dietrich <> Reviewed-by: David Edmundson <> Reviewed-by: Frederik Gladhorn <>
Diffstat (limited to 'src')
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index 403ebe7f49..7e48badea5 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -2177,6 +2177,7 @@ QAction *QMenu::exec()
QAction *QMenu::exec(const QPoint &p, QAction *action)
+ ensurePolished();
QEventLoop eventLoop;
d->eventLoop = &eventLoop;