29 lines
852 B
C
Raw Normal View History

2025-03-13 10:47:10 +08:00
#ifndef CBOXLISTMODEL_H
#define CBOXLISTMODEL_H
#include "Export.h"
#include "QAbstractListModel"
#include "CDrawObjDatabase.h"
class DLL_CLASS CBoxListModel : public QAbstractListModel
{
Q_OBJECT
public:
CBoxListModel(QObject *parent = Q_NULLPTR);
~CBoxListModel();
bool isExist(const QString &name);
DrawObjDatabaseRecord* record(const QModelIndex &index) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
Qt::ItemFlags flags (const QModelIndex & index ) const override;
bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override;
void addWidget(DrawObjDatabaseRecord *record);
private:
QList<DrawObjDatabaseRecord*> m_items;
};
#endif // CBOXLISTMODEL_H