2022-10-02 19:45:46 +00:00
|
|
|
#ifndef DUST3D_APPLICATION_COMPONENT_LIST_MODEL_H_
|
|
|
|
#define DUST3D_APPLICATION_COMPONENT_LIST_MODEL_H_
|
|
|
|
|
|
|
|
#include <QAbstractListModel>
|
|
|
|
#include <dust3d/base/uuid.h>
|
|
|
|
|
|
|
|
class Document;
|
|
|
|
class SkeletonComponent;
|
|
|
|
|
|
|
|
class ComponentListModel: public QAbstractListModel
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2022-10-04 09:50:39 +00:00
|
|
|
signals:
|
|
|
|
void listingComponentChanged(const dust3d::Uuid &componentId);
|
2022-10-02 19:45:46 +00:00
|
|
|
public:
|
|
|
|
ComponentListModel(const Document *document, QObject *parent=nullptr);
|
|
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
|
|
|
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
|
|
|
QVariant data(const QModelIndex &index, int role) const;
|
2022-10-03 00:06:25 +00:00
|
|
|
const SkeletonComponent *modelIndexToComponent(const QModelIndex &index) const;
|
2022-10-04 11:45:21 +00:00
|
|
|
const dust3d::Uuid modelIndexToComponentId(const QModelIndex &index) const;
|
2022-10-04 09:50:39 +00:00
|
|
|
const dust3d::Uuid listingComponentId() const;
|
2022-10-02 19:45:46 +00:00
|
|
|
public slots:
|
|
|
|
void setListingComponentId(const dust3d::Uuid &componentId);
|
|
|
|
private:
|
|
|
|
const Document *m_document = nullptr;
|
|
|
|
dust3d::Uuid m_listingComponentId;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|