CCIMXDesktop
 
Loading...
Searching...
No Matches
CCIMXFileSystemModel.h
1#ifndef CCIMXFILESYSTEMMODEL_H
2#define CCIMXFILESYSTEMMODEL_H
3
4#include <QFileSystemModel>
5
7
13class CCIMXFileSystemModel : public QFileSystemModel {
14public:
19 explicit CCIMXFileSystemModel(QObject* parent = nullptr);
20
26 void bindProviders(QList<FileInfoProvider*>& providers) {
27 this->providers = providers;
28 }
29
37 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
38
47 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
48
54 const QList<FileInfoProvider*>& get_providers() const { return providers; }
55
56private:
57 QList<FileInfoProvider*> providers;
58};
59
60#endif // CCIMXFILESYSTEMMODEL_H
The CCIMXFileSystemModel class Extends QFileSystemModel to support additional information providers....
Definition CCIMXFileSystemModel.h:13
void bindProviders(QList< FileInfoProvider * > &providers)
bindProviders Binds a list of FileInfoProvider instances to this model.
Definition CCIMXFileSystemModel.h:26
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
data Overrides QFileSystemModel::data to provide custom data from providers.
Definition CCIMXFileSystemModel.cpp:7
const QList< FileInfoProvider * > & get_providers() const
get_providers Returns the list of currently bound providers.
Definition CCIMXFileSystemModel.h:54
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
headerData Overrides QFileSystemModel::headerData to provide custom header names.
Definition CCIMXFileSystemModel.cpp:29
The FileInfoProvider class is such an abstract class that using in CCIMXFileSystemModel to provide th...
Definition FileInfoProvider.h:15