QDialog: don't tell native dialog to hide if never shown

If the platform returns false when asked to show a native
dialog, it means that it could not show it. Calling hide
on it later is therefore wrong, and can cause unwanted
side effects.

Change-Id: Icf5bdb5d98f40af6ef70fdbeaff824a535a404b3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
Richard Moe Gustavsen 2015-02-03 12:44:47 +01:00
parent 7d6c6bc082
commit 7a377fe379

View File

@ -127,7 +127,7 @@ bool QDialogPrivate::setNativeDialogVisible(bool visible)
Q_Q(QDialog);
helperPrepareShow(helper);
nativeDialogInUse = helper->show(q->windowFlags(), q->windowModality(), parentWindow());
} else {
} else if (nativeDialogInUse) {
helper->hide();
}
}