added basic models and controllers
This commit is contained in:
parent
269b48ed9d
commit
e401b71788
9 changed files with 222 additions and 2 deletions
40
LenaPi/models/NavigationItemModel.h
Normal file
40
LenaPi/models/NavigationItemModel.h
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue