summaryrefslogtreecommitdiffstats
path: root/src/dialogs/qquickplatformfiledialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dialogs/qquickplatformfiledialog.cpp')
-rw-r--r--src/dialogs/qquickplatformfiledialog.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/dialogs/qquickplatformfiledialog.cpp b/src/dialogs/qquickplatformfiledialog.cpp
index 7ed4e3fbc..141f701d1 100644
--- a/src/dialogs/qquickplatformfiledialog.cpp
+++ b/src/dialogs/qquickplatformfiledialog.cpp
@@ -172,6 +172,21 @@ QQuickPlatformFileDialog::~QQuickPlatformFileDialog()
delete m_dlgHelper;
}
+void QQuickPlatformFileDialog::setModality(Qt::WindowModality m)
+{
+#ifdef Q_OS_WIN
+ // A non-modal native file dialog is not possible on Windows, so
+ // be stubborn about it. Emit modalityChanged() whether it changed
+ // or not, to ensure that anything which depends on the property
+ // will re-read the actual current value.
+ if (m != Qt::ApplicationModal)
+ m = Qt::ApplicationModal;
+ if (m == m_modality)
+ emit modalityChanged();
+#endif
+ QQuickAbstractFileDialog::setModality(m);
+}
+
QPlatformFileDialogHelper *QQuickPlatformFileDialog::helper()
{
QQuickItem *parentItem = qobject_cast<QQuickItem *>(parent());