summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-01-14 16:05:15 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-14 22:33:43 +0100
commit73a98ccc4677056416f5de8797c91097e1000a0c (patch)
treeed5ce7f1f31b28b14048630014aeea9dbbbb53a8
parent122ae7142b2dfd7ec0e03820c1d7f4317d1ce267 (diff)
Windows: Use focusWindow() as native dialog parent when 0 is passed.
A parent is required, otherwise the application gets deactivated when the dialog closes. The same is done in Qt 4. Task-number: QTBUG-36039 Change-Id: I56688b3259f1d207edd1bec499afd1365ae511dc Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
-rw-r--r--src/plugins/platforms/windows/qwindowsdialoghelpers.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
index 497d0975af..8ebfd018d0 100644
--- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
+++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
@@ -572,6 +572,8 @@ bool QWindowsDialogHelperBase<BaseClass>::show(Qt::WindowFlags,
QWindow *parent)
{
const bool modal = (windowModality != Qt::NonModal);
+ if (!parent)
+ parent = QGuiApplication::focusWindow(); // Need a parent window, else the application loses activation when closed.
if (parent) {
m_ownerWindow = QWindowsWindow::handleOf(parent);
} else {