1 #ifndef MODELITEM_HPP 2 #define MODELITEM_HPP 3 4 #include <QMimeData> 5 #include <QList> 6 7 namespace ContentSelectorModel 8 { 9 class ModelItem : public QMimeData 10 { 11 Q_OBJECT 12 13 public: 14 ModelItem(ModelItem *parent = nullptr); 15 //ModelItem(const ModelItem *parent = 0); 16 17 ~ModelItem(); 18 19 ModelItem *parent() const; 20 int row() const; 21 22 int childCount() const; 23 int childRow(ModelItem *child) const; 24 ModelItem *child(int row); 25 26 void appendChild(ModelItem *child); 27 void removeChild(int row); 28 29 bool hasFormat(const QString &mimetype) const override; 30 31 //virtual bool acceptChild(ModelItem *child); 32 33 protected: 34 ModelItem *mParentItem; 35 QList<ModelItem*> mChildItems; 36 }; 37 } 38 39 #endif 40