diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-02-03 12:45:21 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2016-02-22 09:13:04 +0000 |
commit | fc6d5ed18da29138494803baa11c0edc22ace7f4 (patch) | |
tree | 54e4dca130bf6b7e8ef0484086c9f46c23a099b4 /src/gui/kernel/qplatformdialoghelper.h | |
parent | 6129aade0018437d8d65a0051040d7100c8ec681 (diff) |
QFileDialogOptions: Expose default name filter setting.
Move the bool QFileDialogPrivate::defaultFileTypes to QFileDialogOptions
as defaultNameFilters and add a static function returning the
translated default filter string. Let QFileDialogOptions::nameFilters()
return the default filter until a value has been set.
This removes the need for special handling for empty filter lists
in the QPA plugins. As a side effect, Qt Quick Controls's FileDialog
will then also default to "All files" if no filters have been set.
Task-number: QTBUG-50644
Change-Id: I9ba271a472d4fa03767b540ef6f1399f5ca4408e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Diffstat (limited to 'src/gui/kernel/qplatformdialoghelper.h')
-rw-r--r-- | src/gui/kernel/qplatformdialoghelper.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformdialoghelper.h b/src/gui/kernel/qplatformdialoghelper.h index d0594593dd..825dcf293d 100644 --- a/src/gui/kernel/qplatformdialoghelper.h +++ b/src/gui/kernel/qplatformdialoghelper.h @@ -349,6 +349,9 @@ public: void setSidebarUrls(const QList<QUrl> &urls); QList<QUrl> sidebarUrls() const; + bool useDefaultNameFilters() const; + void setUseDefaultNameFilters(bool d); + void setNameFilters(const QStringList &filters); QStringList nameFilters() const; @@ -377,6 +380,8 @@ public: void setSupportedSchemes(const QStringList &schemes); QStringList supportedSchemes() const; + static QString defaultNameFilterString(); + private: QSharedDataPointer<QFileDialogOptionsPrivate> d; }; |