summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-12-10 16:22:09 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-12-10 21:19:01 +0000
commit4339088503919c03c5afbd491c156b5e70c6b03d (patch)
treee7e0f5b2cbfc2a332d7e9b6e790fd35de47e2014 /src/widgets/widgets
parentfbcc6a346b81a04f8a5f1a8a05aa973a58a64fc7 (diff)
macOS: Disable WA_QuitOnClose on menu item widget container
Otherwise it will prevent quitting of the application when the last window is closed, on account of (seemingly) being a top level window. Change-Id: Ib79615dd1e9394c96d39c8f9851005b4c073c165 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 6198ba217f3a9b31d44375b26f3635f15fc01b3d) Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r--src/widgets/widgets/qmenu_mac.mm1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/widgets/qmenu_mac.mm b/src/widgets/widgets/qmenu_mac.mm
index d6e09d9512..2f98ed3488 100644
--- a/src/widgets/widgets/qmenu_mac.mm
+++ b/src/widgets/widgets/qmenu_mac.mm
@@ -115,6 +115,7 @@ void QMenuPrivate::moveWidgetToPlatformItem(QWidget *widget, QPlatformMenuItem*
{
auto *container = new QWidget;
container->setAttribute(Qt::WA_TranslucentBackground);
+ container->setAttribute(Qt::WA_QuitOnClose, false);
QObject::connect(platformMenu, SIGNAL(destroyed()), container, SLOT(deleteLater()));
container->resize(widget->sizeHint());
widget->setParent(container);