--- a/src/model.h Mon Jan 15 08:20:54 2018 +0200 +++ b/src/model.h Tue Feb 13 14:19:07 2018 +0200 @@ -17,13 +17,14 @@ */ #pragma once +#include <QAbstractListModel> #include "main.h" #include "linetypes/modelobject.h" /* * This class represents a LDraw model, consisting of a vector of objects. It manages LDObject ownership. */ -class Model : public QObject +class Model : public QAbstractListModel { Q_OBJECT @@ -58,6 +59,9 @@ LDObject* addFromString(QString line); LDObject* replaceWithFromString(LDObject* object, QString line); + int rowCount(const QModelIndex& parent) const override; + QVariant data(const QModelIndex& index, int role) const override; + signals: void objectAdded(LDObject* object); void aboutToRemoveObject(LDObject* object);