From f4ffe2a2439928992c3f44085e81686d4f911417 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 27 Feb 2014 12:28:48 +0100 Subject: Enable menuless dialogs on Windows. Handle the flags combination Qt::Dialog && !Qt::WindowSystemMenuHint such that it results in exStyle = WS_EX_DLGMODALFRAME and style = WS_POPUP | WS_BORDER | WS_SYSMENU and a window class without icon. Do not set !Qt::WindowSystemMenuHint in QWidgetPrivate::adjustFlags() for dialogs on Windows. [ChangeLog][QtWidgets][QDialog][Windows] Dialogs can now be menuless. Task-number: QTBUG-2027 Change-Id: Ieb86985e8a5291d826c103fe478ecde43971f08e Reviewed-by: Joerg Bornemann --- src/widgets/kernel/qwidget.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index ba8147c4a6..c52e0d47ce 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1064,7 +1064,11 @@ void QWidgetPrivate::adjustFlags(Qt::WindowFlags &flags, QWidget *w) // interpret WindowSystemMenuHint as a close button and we can't change that behavior // we can't just add this in. #ifndef Q_WS_MAC - if (flags & (Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint | Qt::WindowContextHelpButtonHint)) { + if ((flags & (Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint | Qt::WindowContextHelpButtonHint)) +# ifdef Q_OS_WIN + && type != Qt::Dialog // QTBUG-2027, allow for menu-less dialogs. +# endif + ) { flags |= Qt::WindowSystemMenuHint; #else if (flags & (Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint -- cgit v1.2.3