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 <Friedemann.Kleint@digia.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
This commit is contained in:
parent
e0e86d5651
commit
df3720527d
@ -2177,6 +2177,7 @@ QAction *QMenu::exec()
|
||||
QAction *QMenu::exec(const QPoint &p, QAction *action)
|
||||
{
|
||||
Q_D(QMenu);
|
||||
ensurePolished();
|
||||
createWinId();
|
||||
QEventLoop eventLoop;
|
||||
d->eventLoop = &eventLoop;
|
||||
|
Loading…
Reference in New Issue
Block a user