18#ifndef ELEMENTSMODEL_H
19#define ELEMENTSMODEL_H
21#include <QAbstractListModel>
28class ElementsModel :
public QAbstractListModel
34 ThumbnailRole = Qt::UserRole + 1,
39 explicit ElementsModel(QObject *parent =
nullptr);
40 explicit ElementsModel(
const QDir &dir, QObject *parent =
nullptr);
42 int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
43 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const override;
44 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole)
override;
45 Qt::ItemFlags flags(
const QModelIndex &index)
const override;
48 void updateThumbnail(
const QString &filePath, QImage &image,
const QModelIndex &persistentIndex);
51 void setDir(
const QDir &dir);
54 void setDirs(
const QList<QDir> &dirs);
58 QList<QFileInfo> m_files;
59 QHash<int, QImage> m_overrideThumbnails;