aboutsummaryrefslogtreecommitdiffstats
path: root/src/labs/folderlistmodel/qquickfolderlistmodel.cpp
diff options
context:
space:
mode:
authorSze Howe Koh <szehowe.koh@gmail.com>2023-06-02 11:37:09 +0800
committerSze Howe Koh <szehowe.koh@gmail.com>2023-06-07 02:40:57 +0000
commit69a25c5d40bca46ad54d4e9b39778bd5257c6daa (patch)
treec3f44206c9afbf291b18213d42926a35c68e7378 /src/labs/folderlistmodel/qquickfolderlistmodel.cpp
parent0c615d61ba4705894c2d25c5fc7a2ed406bd5942 (diff)
Doc: Expand FolderListModel documentation
* Document the data types exposed by FolderListModel * Fully-qualify the enum values of FolderListModel::sortField and mark default value * Mark read-only properties Change-Id: Ib829a69cf762f4aaf1e50f2e526f64da429e128b Pick-to: 6.6 6.5 6.2 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/labs/folderlistmodel/qquickfolderlistmodel.cpp')
-rw-r--r--src/labs/folderlistmodel/qquickfolderlistmodel.cpp53
1 files changed, 28 insertions, 25 deletions
diff --git a/src/labs/folderlistmodel/qquickfolderlistmodel.cpp b/src/labs/folderlistmodel/qquickfolderlistmodel.cpp
index 30dfd91436..31466f182f 100644
--- a/src/labs/folderlistmodel/qquickfolderlistmodel.cpp
+++ b/src/labs/folderlistmodel/qquickfolderlistmodel.cpp
@@ -232,16 +232,16 @@ QString QQuickFolderListModelPrivate::resolvePath(const QUrl &path)
Components access names and paths via the following roles:
\list
- \li \c fileName
- \li \c filePath
- \li \c fileURL (since Qt 5.2; deprecated since Qt 5.15)
- \li \c fileUrl (since Qt 5.15)
- \li \c fileBaseName
- \li \c fileSuffix
- \li \c fileSize
- \li \c fileModified
- \li \c fileAccessed
- \li \c fileIsDir
+ \li \c fileName (\c string)
+ \li \c filePath (\c string)
+ \li \c fileURL (\c url) (since Qt 5.2; deprecated since Qt 5.15)
+ \li \c fileUrl (\c url) (since Qt 5.15)
+ \li \c fileBaseName (\c string)
+ \li \c fileSuffix (\c string)
+ \li \c fileSize (\c qlonglong)
+ \li \c fileModified (\c date)
+ \li \c fileAccessed (\c date)
+ \li \c fileIsDir (\c bool)
\endlist
Additionally a file entry can be differentiated from a folder entry via the
@@ -375,6 +375,7 @@ QHash<int, QByteArray> QQuickFolderListModel::roleNames() const
/*!
\qmlproperty int FolderListModel::count
+ \readonly
Returns the number of items in the current folder that match the
filter criteria.
@@ -474,6 +475,7 @@ void QQuickFolderListModel::setRootFolder(const QUrl &path)
/*!
\qmlproperty url FolderListModel::parentFolder
+ \readonly
Returns the URL of the parent of the current \l folder.
*/
@@ -547,11 +549,11 @@ void QQuickFolderListModel::componentComplete()
The \a sortField property contains the field to use for sorting.
\c sortField may be one of:
- \value Unsorted no sorting is applied
- \value Name sort by filename
- \value Time sort by time modified
- \value Size sort by file size
- \value Type sort by file type (extension)
+ \value FolderListModel.Unsorted no sorting is applied
+ \value FolderListModel.Name sort by filename (default)
+ \value FolderListModel.Time sort by time modified
+ \value FolderListModel.Size sort by file size
+ \value FolderListModel.Type sort by file type/extension
\sa sortReversed
*/
@@ -799,6 +801,7 @@ void QQuickFolderListModel::setCaseSensitive(bool on)
/*!
\qmlproperty enumeration FolderListModel::status
\since 5.11
+ \readonly
This property holds the status of folder reading. It can be one of:
@@ -865,16 +868,16 @@ void QQuickFolderListModel::setSortCaseSensitive(bool on)
are available:
\list
- \li \c fileName
- \li \c filePath
- \li \c fileURL (since Qt 5.2; deprecated since Qt 5.15)
- \li \c fileUrl (since Qt 5.15)
- \li \c fileBaseName
- \li \c fileSuffix
- \li \c fileSize
- \li \c fileModified
- \li \c fileAccessed
- \li \c fileIsDir
+ \li \c fileName (\c string)
+ \li \c filePath (\c string)
+ \li \c fileURL (\c url) (since Qt 5.2; deprecated since Qt 5.15)
+ \li \c fileUrl (\c url) (since Qt 5.15)
+ \li \c fileBaseName (\c string)
+ \li \c fileSuffix (\c string)
+ \li \c fileSize (\c qlonglong)
+ \li \c fileModified (\c date)
+ \li \c fileAccessed (\c date)
+ \li \c fileIsDir (\c bool)
\endlist
*/
QVariant QQuickFolderListModel::get(int idx, const QString &property) const