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>
This commit is contained in:
Friedemann Kleint 2014-01-14 16:05:15 +01:00 committed by The Qt Project
parent 122ae7142b
commit 73a98ccc46

View File

@ -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 {