summaryrefslogtreecommitdiff
path: root/src/dialogs/qquickabstractfiledialog_p.h
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2014-08-22 16:21:41 +0200
committerShawn Rutledge <shawn.rutledge@digia.com>2014-09-04 13:33:53 +0200
commitf4605583e857c11247f557d665e267a1711d561b (patch)
tree751622a021b78c1f3b330602f3c55357c9dbf17d /src/dialogs/qquickabstractfiledialog_p.h
parent2ba820668c86684abcad4a2b69ac49e1af9de010 (diff)
downloadqtquickcontrols-f4605583e857c11247f557d665e267a1711d561b.tar.gz
FileDialog: add sidebarVisible property and button
The sidebar takes up too much space on some devices, so now it is possible for the application author to hide it by default. The user can also toggle it with a button similar to that used for the Qt Creator sidebar, and this state is stored as a setting; however if the application sets sidebarVisible: false, that overrides the setting. [ChangeLog][QtQuick.Dialogs] FileDialog: added sidebarVisible property and button Task-number: QTBUG-39231 Change-Id: Ie8b379da02f4b12764732b2c01b79039722778ab Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/dialogs/qquickabstractfiledialog_p.h')
-rw-r--r--src/dialogs/qquickabstractfiledialog_p.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dialogs/qquickabstractfiledialog_p.h b/src/dialogs/qquickabstractfiledialog_p.h
index 499b645d..aa740b12 100644
--- a/src/dialogs/qquickabstractfiledialog_p.h
+++ b/src/dialogs/qquickabstractfiledialog_p.h
@@ -65,6 +65,7 @@ class QQuickAbstractFileDialog : public QQuickAbstractDialog
Q_PROPERTY(int selectedNameFilterIndex READ selectedNameFilterIndex WRITE setSelectedNameFilterIndex NOTIFY filterSelected)
Q_PROPERTY(QUrl fileUrl READ fileUrl NOTIFY selectionAccepted)
Q_PROPERTY(QList<QUrl> fileUrls READ fileUrls NOTIFY selectionAccepted)
+ Q_PROPERTY(bool sidebarVisible READ sidebarVisible WRITE setSidebarVisible NOTIFY sidebarVisibleChanged)
public:
QQuickAbstractFileDialog(QObject *parent = 0);
@@ -81,6 +82,7 @@ public:
int selectedNameFilterIndex() const;
QUrl fileUrl() const;
virtual QList<QUrl> fileUrls() const;
+ bool sidebarVisible() const { return m_sidebarVisible; }
public Q_SLOTS:
void setVisible(bool v);
@@ -92,6 +94,7 @@ public Q_SLOTS:
void setNameFilters(const QStringList &f);
void selectNameFilter(const QString &f);
void setSelectedNameFilterIndex(int idx);
+ void setSidebarVisible(bool s);
Q_SIGNALS:
void folderChanged();
@@ -99,6 +102,7 @@ Q_SIGNALS:
void filterSelected();
void fileModeChanged();
void selectionAccepted();
+ void sidebarVisibleChanged();
protected:
void updateModes();
@@ -109,6 +113,7 @@ protected:
bool m_selectExisting;
bool m_selectMultiple;
bool m_selectFolder;
+ bool m_sidebarVisible;
Q_DISABLE_COPY(QQuickAbstractFileDialog)
};