#ifndef MODELITEMLISTMODEL_H
#define MODELITEMLISTMODEL_H

#include <QObject>
#include <QAbstractListModel>


struct ModelItem
{
    QString m_modelName;
    QString m_description;
    bool m_isChecked = false;
};

class ModelItemListModel : public QAbstractListModel
{
    Q_OBJECT
public:
    enum ModelRoles {
        NameRole = Qt::UserRole + 1,
        DescriptionRole,
        IsCheckedRole
    };

    explicit ModelItemListModel(QObject *parent = nullptr);
    ~ModelItemListModel();
    static ModelItemListModel *getInstance();

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

    void setItems(const QList<ModelItem*>& items);
    QHash<int, QByteArray> roleNames() const override;

private:
    QList<ModelItem*> m_items;
    static ModelItemListModel * m_ptr;
};

#endif // MODELITEMLISTMODEL_H
