diff options
author | Ilya Kotov <i.kotov@rusbitech.ru> | 2018-01-10 16:32:27 +0300 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-01-28 09:43:02 +0000 |
commit | e29047555be764d59c52801553e23767ed367cec (patch) | |
tree | d98647b57e29d28c7250b9d7ea581854a167b985 /src/imports/folderlistmodel/qquickfolderlistmodel.h | |
parent | e8f3f37bc2d05190c4f16c372a487901e0d2e03d (diff) |
FolderListModel: add status property
This allows to track directory loading
Task-number: QTBUG-48708
Change-Id: If79a325ef1bfc831d3bc2a205e3127a571fcb0c1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/imports/folderlistmodel/qquickfolderlistmodel.h')
-rw-r--r-- | src/imports/folderlistmodel/qquickfolderlistmodel.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.h b/src/imports/folderlistmodel/qquickfolderlistmodel.h index dee73dff3e..a449f0dd0f 100644 --- a/src/imports/folderlistmodel/qquickfolderlistmodel.h +++ b/src/imports/folderlistmodel/qquickfolderlistmodel.h @@ -75,6 +75,7 @@ class QQuickFolderListModel : public QAbstractListModel, public QQmlParserStatus Q_PROPERTY(bool showOnlyReadable READ showOnlyReadable WRITE setShowOnlyReadable) Q_PROPERTY(bool caseSensitive READ caseSensitive WRITE setCaseSensitive REVISION 2) Q_PROPERTY(int count READ count NOTIFY countChanged) + Q_PROPERTY(Status status READ status NOTIFY statusChanged REVISION 11) //![class props] //![abslistmodel] @@ -137,6 +138,10 @@ public: void setShowOnlyReadable(bool on); bool caseSensitive() const; void setCaseSensitive(bool on); + + enum Status { Null, Ready, Loading }; + Q_ENUM(Status) + Status status() const; //![prop funcs] Q_INVOKABLE bool isFolder(int index) const; @@ -155,6 +160,7 @@ Q_SIGNALS: void folderChanged(); void rowCountChanged() const; Q_REVISION(1) void countChanged() const; + Q_REVISION(11) void statusChanged(); //![notifier] //![class end] @@ -168,6 +174,7 @@ private: Q_PRIVATE_SLOT(d_func(), void _q_directoryChanged(const QString &directory, const QList<FileProperty> &list)) Q_PRIVATE_SLOT(d_func(), void _q_directoryUpdated(const QString &directory, const QList<FileProperty> &list, int fromIndex, int toIndex)) Q_PRIVATE_SLOT(d_func(), void _q_sortFinished(const QList<FileProperty> &list)) + Q_PRIVATE_SLOT(d_func(), void _q_statusChanged(QQuickFolderListModel::Status s)) }; //![class end] |