-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileModel.h
More file actions
31 lines (24 loc) · 1002 Bytes
/
FileModel.h
File metadata and controls
31 lines (24 loc) · 1002 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef FILEMODEL_H
#define FILEMODEL_H
#include <QAbstractItemModel>
class Theme;
class FileItem;
class FileModel : public QAbstractItemModel {
Q_OBJECT
public:
explicit FileModel(Theme* theme, QObject* parent = nullptr);
~FileModel();
QVariant data(const QModelIndex& index, int role) const override;
Qt::ItemFlags flags(const QModelIndex& index) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
QModelIndex parent(const QModelIndex& index) const override;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
void appendFileItems(const QString& dirPath, FileItem* parent);
FileItem* rootItem() const;
private:
FileItem* _rootItem;
Theme* _theme;
};
#endif // FILEMODEL_H