18#ifndef ELEMENTSMODEL_H
19#define ELEMENTSMODEL_H
21#include <QAbstractListModel>
27class ElementsModel :
public QAbstractListModel
33 ThumbnailRole = Qt::UserRole + 1,
38 explicit ElementsModel(
const QDir &dir, QObject *parent =
nullptr);
40 int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
41 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const override;
42 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole)
override;
43 Qt::ItemFlags flags(
const QModelIndex &index)
const override;
46 void updateThumbnail(
const QString &filePath, QImage &image,
const QModelIndex &persistentIndex);
49 void setDir(
const QDir &dir);
53 QList<QFileInfo> m_files;
54 QHash<int, QImage> m_overrideThumbnails;