added basic models and controllers

This commit is contained in:
Anika Raemer 2018-10-19 14:19:19 +02:00
parent 269b48ed9d
commit e401b71788
9 changed files with 222 additions and 2 deletions

View file

@ -0,0 +1,40 @@
#ifndef NAVIGATIONITEMMODEL_H
#define NAVIGATIONITEMMODEL_H
#include <QObject>
class NavigationItemModel : public QObject
{
Q_OBJECT
Q_PROPERTY(QString pImageSource READ getImageSource NOTIFY imageSourceChanged)
signals:
void imageSourceChanged();
void clicked();
public:
NavigationItemModel(QObject *parent = Q_NULLPTR);
QString getImageSource() const;
QString getPath() const;
bool setPath(const QString & path);
NavigationItemModel* getParentItem();
QList<NavigationItemModel*> getChildren();
void appendChild(NavigationItemModel* item);
void clearChildren();
Q_INVOKABLE void onClicked();
private:
QString mPath = QString("");
QString mImageSource;
QList<NavigationItemModel*> mChildren = QList<NavigationItemModel*>();
NavigationItemModel* mParentItem = nullptr;
};
#endif // NAVIGATIONITEMMODEL_H