path: root/src/gui/kernel/qplatformdialoghelper.cpp
diff options
authorDavid Faure <>2015-05-09 14:12:28 +0200
committerDavid Faure <>2015-07-17 14:29:47 +0000
commit5443da6c2795255db55697471190b3eba16b28dc (patch)
tree4c6d0d26eb7ff2065f77bf70328563a476c71f31 /src/gui/kernel/qplatformdialoghelper.cpp
parent4e4b16dc1789f660f25bea3a9b9111053de2cc61 (diff)
QFileDialog: add setSupportedSchemes and pass it along to the QPA.
This also finishes the implementation of the static methods which were being passed a supportedSchemes argument but weren't using it. Now they can pass it along to the QFileDialog instance, which then passes it to the helper used by the QPA implementation of the file dialog. The default implementation only supports local files and can therefore ignore this, but other implementations can use this argument to restrict the protocols allowed to the user. [ChangeLog][Widgets][QFileDialog] Add supportedSchemes property. Change-Id: I5235f70e785da1c06866a8355ef98f571890c4a2 Reviewed-by: Kevin Ottens <> Reviewed-by: Friedemann Kleint <>
Diffstat (limited to 'src/gui/kernel/qplatformdialoghelper.cpp')
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformdialoghelper.cpp b/src/gui/kernel/qplatformdialoghelper.cpp
index 2d0458f705..25894fd504 100644
--- a/src/gui/kernel/qplatformdialoghelper.cpp
+++ b/src/gui/kernel/qplatformdialoghelper.cpp
@@ -422,6 +422,7 @@ public:
QUrl initialDirectory;
QString initiallySelectedNameFilter;
QList<QUrl> initiallySelectedFiles;
+ QStringList supportedSchemes;
QFileDialogOptions::QFileDialogOptions() : d(new QFileDialogOptionsPrivate)
@@ -613,6 +614,18 @@ void QFileDialogOptions::setInitiallySelectedFiles(const QList<QUrl> &files)
d->initiallySelectedFiles = files;
+// Schemes supported by the application
+void QFileDialogOptions::setSupportedSchemes(const QStringList &schemes)
+ d->supportedSchemes = schemes;
+QStringList QFileDialogOptions::supportedSchemes() const
+ return d->supportedSchemes;
+// Return true if the URL is supported by the filedialog implementation *and* by the application.
bool QPlatformFileDialogHelper::isSupportedUrl(const QUrl &url) const
return url.isLocalFile();