CCIMXDesktop
 
Loading...
Searching...
No Matches
FileInfoProvider Class Referenceabstract

The FileInfoProvider class is such an abstract class that using in CCIMXFileSystemModel to provide the file information, which, we can modify the file information provide easily in the model. More...

#include <FileInfoProvider.h>

Inheritance diagram for FileInfoProvider:
DirentSizeCounter FileCountInfo FileNameProviders FileTypeInfo

Public Member Functions

 Q_DISABLE_COPY (FileInfoProvider)
 disable copy object
 
 FileInfoProvider ()=delete
 Construct a new File Info Provider object default is prohibited, disable this for the default constructor, prevent the non-model register.
 
 FileInfoProvider (CCIMXFileSystemModel *models)
 Construct a new File Info Provider object, assigned models requires.
 
virtual ~FileInfoProvider ()=default
 Destroy the File Info Provider object.
 
virtual QString provide_section_name ()=0
 One InfoProvider for one section header name, the function do the case :)
 
void setCurrentHandlePath (const QString &path)
 setCurrentHandlePath set the current handle path
 
QString currentHandlePath ()
 currentHandlePath get the current handle path
 
virtual std::pair< bool, QVariant > data (const QModelIndex &index, int role)=0
 functions provide what to display
 

Protected Attributes

CCIMXFileSystemModelmodels
 binding models
 

Detailed Description

The FileInfoProvider class is such an abstract class that using in CCIMXFileSystemModel to provide the file information, which, we can modify the file information provide easily in the model.

Constructor & Destructor Documentation

◆ FileInfoProvider()

FileInfoProvider::FileInfoProvider ( CCIMXFileSystemModel models)
inline

Construct a new File Info Provider object, assigned models requires.

Parameters
models

Member Function Documentation

◆ currentHandlePath()

QString FileInfoProvider::currentHandlePath ( )
inline

currentHandlePath get the current handle path

Returns
the current handle path

◆ data()

virtual std::pair< bool, QVariant > FileInfoProvider::data ( const QModelIndex &  index,
int  role 
)
pure virtual

functions provide what to display

Parameters
indexthe model index
rolethe role of the index
Returns
returns the data of the index, if the data is not available, it will return with {false, {}}
Note
for developers re-develop the sessions, you can modified to the implements with std::optional<QVariant>, QVariant itself invalid means something in model that is meaningful, so, QVariant's invalid don't mean the data itself invalid

Implemented in DirentSizeCounter, FileCountInfo, FileNameProviders, and FileTypeInfo.

◆ provide_section_name()

virtual QString FileInfoProvider::provide_section_name ( )
inlinepure virtual

One InfoProvider for one section header name, the function do the case :)

Returns
the section name

Implemented in DirentSizeCounter, FileCountInfo, FileNameProviders, and FileTypeInfo.

◆ setCurrentHandlePath()

void FileInfoProvider::setCurrentHandlePath ( const QString &  path)
inline

setCurrentHandlePath set the current handle path

Parameters
paththe path to be set

The documentation for this class was generated from the following file: