summaryrefslogtreecommitdiffstats
path: root/tests/manual/dialogs/filedialogpanel.h
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2013-08-27 14:10:45 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-29 10:25:01 +0200
commitee9b9d9fd9a714f97ed8f7e26404c2f113588e9c (patch)
tree3cf5ef3432cf746fa395fee1ff104524a20da8b2 /tests/manual/dialogs/filedialogpanel.h
parent468b539935331e7cd2eda8e5d2eef07b8e5508e9 (diff)
QFileDialog: add MIME Type filters
Currently just a convenience method for setNameFilters(), it uses QMimeType to create a name filter from the glob patterns and description defined in each MIME type. In the longer term, this API could be used to do proper mimetype-based filtering using QMimeDatabase::mimeTypeForFile() in the builtin QFileDialog (aka "not native"), instead of only looking at globs via the name filters. Change-Id: I0edccf5f30c514481b47cd100d743d1ed7a24024 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'tests/manual/dialogs/filedialogpanel.h')
-rw-r--r--tests/manual/dialogs/filedialogpanel.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/manual/dialogs/filedialogpanel.h b/tests/manual/dialogs/filedialogpanel.h
index 2e1d5d4de9..1e86e0f18e 100644
--- a/tests/manual/dialogs/filedialogpanel.h
+++ b/tests/manual/dialogs/filedialogpanel.h
@@ -52,6 +52,7 @@ class QCheckBox;
class QComboBox;
class QLineEdit;
class QPlainTextEdit;
+class QFormLayout;
QT_END_NAMESPACE
class LabelLineEdit;
@@ -82,6 +83,7 @@ public slots:
private slots:
void enableDeleteNonModalDialogButton();
void enableDeleteModalDialogButton();
+ void useMimeTypeFilters(bool);
private:
QString filterString() const;
@@ -89,6 +91,7 @@ private:
QStringList allowedSchemes() const;
void applySettings(QFileDialog *d) const;
+ QFormLayout *filesLayout;
QCheckBox *m_readOnly;
QCheckBox *m_confirmOverWrite;
QCheckBox *m_nameFilterDetailsVisible;
@@ -103,6 +106,7 @@ private:
QLineEdit *m_directory;
QLineEdit *m_selectedFileName;
QList<LabelLineEdit *> m_labelLineEdits;
+ QCheckBox *m_useMimeTypeFilters;
QPlainTextEdit *m_nameFilters;
QLineEdit *m_selectedNameFilter;
QPushButton *m_deleteNonModalDialogButton;