diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2014-10-30 15:29:13 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@digia.com> | 2014-10-30 15:36:47 +0100 |
commit | 41e66ea6daa47d940365a458e7a12977bb32c690 (patch) | |
tree | 44affbaf9282e2451f080379a41522279264aabf /src/dialogs/qquickplatformfiledialog.cpp | |
parent | 3a851dfd4078b3ca9f9c1b06424b136cc6f852c5 (diff) | |
download | qtquickcontrols-41e66ea6daa47d940365a458e7a12977bb32c690.tar.gz |
Dialogs: FileDialog can only be modal on Windows
The autotest has been failing on Windows because of this.
Change-Id: I6ec42a256455d7a71a522fa7e75dc44f93b741ea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/dialogs/qquickplatformfiledialog.cpp')
-rw-r--r-- | src/dialogs/qquickplatformfiledialog.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/dialogs/qquickplatformfiledialog.cpp b/src/dialogs/qquickplatformfiledialog.cpp index 7ed4e3fb..141f701d 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()); |