CCIMXDesktop
 
Loading...
Searching...
No Matches
FileInfoProvider.h
1#ifndef FILEINFOPROVIDER_H
2#define FILEINFOPROVIDER_H
3#include <QModelIndex>
4#include <QString>
5#include <QtClassHelperMacros>
6
8/* Interfaces are provided in virtual class */
9
16public:
27 FileInfoProvider() = delete;
34 this->models = models;
35 };
40 virtual ~FileInfoProvider() = default;
41
47 virtual inline QString provide_section_name() = 0;
48
53 inline void setCurrentHandlePath(const QString& path) { cached_path = path; }
54
59 inline QString currentHandlePath() { return cached_path; }
60
72 virtual std::pair<bool, QVariant> data(const QModelIndex& index, int role) = 0;
73
74protected:
76
77private:
78 QString cached_path {};
79};
80
81#endif // FILEINFOPROVIDER_H
The CCIMXFileSystemModel class Extends QFileSystemModel to support additional information providers....
Definition CCIMXFileSystemModel.h:13
The FileInfoProvider class is such an abstract class that using in CCIMXFileSystemModel to provide th...
Definition FileInfoProvider.h:15
Q_DISABLE_COPY(FileInfoProvider)
disable copy object
virtual QString provide_section_name()=0
One InfoProvider for one section header name, the function do the case :)
QString currentHandlePath()
currentHandlePath get the current handle path
Definition FileInfoProvider.h:59
virtual std::pair< bool, QVariant > data(const QModelIndex &index, int role)=0
functions provide what to display
void setCurrentHandlePath(const QString &path)
setCurrentHandlePath set the current handle path
Definition FileInfoProvider.h:53
virtual ~FileInfoProvider()=default
Destroy the File Info Provider object.
FileInfoProvider()=delete
Construct a new File Info Provider object default is prohibited, disable this for the default constru...
FileInfoProvider(CCIMXFileSystemModel *models)
Construct a new File Info Provider object, assigned models requires.
Definition FileInfoProvider.h:33
CCIMXFileSystemModel * models
binding models
Definition FileInfoProvider.h:75