summaryrefslogtreecommitdiffstats
path: root/src/gui/itemmodels/qfilesystemmodel.h
diff options
context:
space:
mode:
authorSune Vuorela <sune@vuorela.dk>2024-03-21 12:05:27 +0100
committerSune Vuorela <sune@vuorela.dk>2024-04-11 23:12:42 +0100
commit19258608e9ea02043ce9b53d4a9c99700ce49c1b (patch)
treeb7b54989a235c37f8eadbe0b4132d75e4f4f86f2 /src/gui/itemmodels/qfilesystemmodel.h
parentc6a2f7a70e40a6df71342ffceb5eb897af71350c (diff)
QFileSystemModel: Add role for fileinfo
Instead of having users traverse a ProxyModel hierarchy to get to a QFileSystemModel to use the fileInfo(QModelIndex) function, just let it be available with the roles. Change-Id: I285347d1d85b4c6253fcb893737aa629a56e27fd Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Diffstat (limited to 'src/gui/itemmodels/qfilesystemmodel.h')
-rw-r--r--src/gui/itemmodels/qfilesystemmodel.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/itemmodels/qfilesystemmodel.h b/src/gui/itemmodels/qfilesystemmodel.h
index 17bce1946f..1fd1041f15 100644
--- a/src/gui/itemmodels/qfilesystemmodel.h
+++ b/src/gui/itemmodels/qfilesystemmodel.h
@@ -32,11 +32,13 @@ Q_SIGNALS:
void directoryLoaded(const QString &path);
public:
+ // ### Qt 7: renumber these values to be before Qt::UserRole comment.
enum Roles {
FileIconRole = Qt::DecorationRole,
+ FileInfoRole = Qt::UserRole - 1,
FilePathRole = Qt::UserRole + 1,
FileNameRole = Qt::UserRole + 2,
- FilePermissions = Qt::UserRole + 3
+ FilePermissions = Qt::UserRole + 3,
};
enum Option