mirror of
https://github.com/QuasarApp/QtDeployer.git
synced 2025-04-29 06:54:31 +00:00
29 lines
591 B
C++
29 lines
591 B
C++
#ifndef LISTMODEL_H
|
|
#define LISTMODEL_H
|
|
|
|
#include <QStandardItemModel>
|
|
|
|
class ListModel : public QStandardItemModel
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ListModel(QObject *parent = nullptr);
|
|
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
|
|
|
// Editable:
|
|
bool setData(const QModelIndex &index, const QVariant &value,
|
|
int role = Qt::EditRole) override;
|
|
|
|
void setSource(const QStringList &source);
|
|
|
|
QStringList getSelectedList(bool all) const;
|
|
|
|
private:
|
|
|
|
QList<QPair<QString, bool>> source;
|
|
};
|
|
|
|
#endif // LISTMODEL_H
|