#ifndef NAVIGATIONITEMMODEL_H #define NAVIGATIONITEMMODEL_H #include class NavigationItemModel : public QObject { Q_OBJECT Q_PROPERTY(QString pImageSource READ getImageSource NOTIFY imageSourceChanged) Q_PROPERTY(bool pIsCircleDelegate READ isCircleDelegate NOTIFY isCircleDelegateChanged) signals: void isCircleDelegateChanged(); void imageSourceChanged(); void clicked(); public: NavigationItemModel(QObject *parent = Q_NULLPTR); QString getImageSource() const; QString getPath() const; bool setPath(const QString & path); bool isCircleDelegate() const; void setCircleDelegate(bool value); bool isRoot() const; NavigationItemModel* getParentItem(); bool hasChildren() const; QList getChildren(); QList getSiblings(); void appendChild(NavigationItemModel* item); void clearChildren(); Q_INVOKABLE void onClicked(); private: QString mPath = QString(""); QString mImageSource; QList mChildren = QList(); NavigationItemModel* mParentItem; }; #endif // NAVIGATIONITEMMODEL_H