Ensure the QMenu is polished before creating the native window
authorMartin Gräßlin <mgraesslin@kde.org>
Mon, 28 Apr 2014 07:42:10 +0000 (09:42 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 9 May 2014 10:16:05 +0000 (12:16 +0200)
commitdf3720527dddad4c04ad1a6b7c07f4bd66495053
tree64b9f986c5c61e1f1f24bc0a141fedb6db1bb182
parente0e86d5651cc8b430b381f1278c917e51671d23e
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>
src/widgets/widgets/qmenu.cpp