CCIMXDesktop
 
Loading...
Searching...
No Matches
CCIMXFileSystemModel Class Reference

The CCIMXFileSystemModel class Extends QFileSystemModel to support additional information providers. Providers can add custom data for files/directories. More...

#include <CCIMXFileSystemModel.h>

Inheritance diagram for CCIMXFileSystemModel:

Public Member Functions

 CCIMXFileSystemModel (QObject *parent=nullptr)
 Constructor with optional parent.
 
void bindProviders (QList< FileInfoProvider * > &providers)
 bindProviders Binds a list of FileInfoProvider instances to this model.
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 data Overrides QFileSystemModel::data to provide custom data from providers.
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 headerData Overrides QFileSystemModel::headerData to provide custom header names.
 
const QList< FileInfoProvider * > & get_providers () const
 get_providers Returns the list of currently bound providers.
 

Detailed Description

The CCIMXFileSystemModel class Extends QFileSystemModel to support additional information providers. Providers can add custom data for files/directories.

Constructor & Destructor Documentation

◆ CCIMXFileSystemModel()

CCIMXFileSystemModel::CCIMXFileSystemModel ( QObject *  parent = nullptr)
explicit

Constructor with optional parent.

Parameters
parentPointer to the QObject parent, default nullptr.

Member Function Documentation

◆ bindProviders()

void CCIMXFileSystemModel::bindProviders ( QList< FileInfoProvider * > &  providers)
inline

bindProviders Binds a list of FileInfoProvider instances to this model.

Parameters
providersList of pointers to FileInfoProvider.

◆ data()

QVariant CCIMXFileSystemModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
override

data Overrides QFileSystemModel::data to provide custom data from providers.

Parameters
indexModel index.
roleData role.
Returns
QVariant containing the data for the given index and role.

◆ get_providers()

const QList< FileInfoProvider * > & CCIMXFileSystemModel::get_providers ( ) const
inline

get_providers Returns the list of currently bound providers.

Returns
const reference to the QList of FileInfoProvider pointers.

◆ headerData()

QVariant CCIMXFileSystemModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
override

headerData Overrides QFileSystemModel::headerData to provide custom header names.

Parameters
sectionSection index.
orientationHorizontal or Vertical.
roleData role.
Returns
QVariant containing header text.

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