File Manager
A simple file manager written in C++ using Qt 6.
Loading...
Searching...
No Matches
QFileInfoListModel Class Reference

The QFileInfoListModel class is a model for a list of QFileInfo objects. More...

#include <qfileinfolistmodel.h>

Inheritance diagram for QFileInfoListModel:
[legend]
Collaboration diagram for QFileInfoListModel:
[legend]

Public Member Functions

 QFileInfoListModel (QObject *parent=nullptr)
 
 ~QFileInfoListModel ()
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
int columnCount (const QModelIndex &parent) const override
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
void setQFileInfoList (const QList< QFileInfo > &fileInfos)
 QFileInfoListModel::setQFileInfoList.
 

Detailed Description

The QFileInfoListModel class is a model for a list of QFileInfo objects.

References:

The implementations of the Qt library classes QStringListModel and QAbstractItemModel were also referenced during the creation of this model.

Warning: This class overrides only a few functions, just enough to make it work for its current usages. Before using it elsewhere, you may need to adapt it to your requirements.

Constructor & Destructor Documentation

◆ QFileInfoListModel()

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

◆ ~QFileInfoListModel()

QFileInfoListModel::~QFileInfoListModel ( )

Member Function Documentation

◆ columnCount()

int QFileInfoListModel::columnCount ( const QModelIndex & parent) const
override

◆ data()

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

◆ headerData()

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

◆ rowCount()

int QFileInfoListModel::rowCount ( const QModelIndex & parent = QModelIndex()) const
override

◆ setQFileInfoList()

void QFileInfoListModel::setQFileInfoList ( const QList< QFileInfo > & fileInfos)

QFileInfoListModel::setQFileInfoList.

Parameters
fileInfos

Sets the model's internal QFileInfo list to fileInfos. The model will notify any attached views that its underlying data has changed.


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