diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2014-02-27 12:28:48 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-28 21:27:41 +0100 |
commit | f4ffe2a2439928992c3f44085e81686d4f911417 (patch) | |
tree | 2dd3a236e17c798ebe8e10c206c5e78cc31d8e57 /src/plugins/platforms/windows/qwindowscontext.cpp | |
parent | db8167c224348fe828aaa0746701b7fa3040c2df (diff) |
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 <joerg.bornemann@digia.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowscontext.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowscontext.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index f67fb9bc19..c35af3623a 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -412,9 +412,17 @@ QString QWindowsContext::registerWindowClass(const QWindow *w, bool isGL) && (type == Qt::Popup || w->property("_q_windowsDropShadow").toBool())) { style |= CS_DROPSHADOW; } - if (type == Qt::Tool || type == Qt::ToolTip || type == Qt::Popup) { + switch (type) { + case Qt::Tool: + case Qt::ToolTip: + case Qt::Popup: style |= CS_SAVEBITS; // Save/restore background icon = false; + break; + case Qt::Dialog: + if (!(flags & Qt::WindowSystemMenuHint)) + icon = false; // QTBUG-2027, dialogs without system menu. + break; } // Create a unique name for the flag combination QString cname = QStringLiteral("Qt5QWindow"); |