lena_pi/LenaPi/controllers/NavigationController.h

34 lines
707 B
C++

#ifndef NAVIGATIONCONTROLLER_H
#define NAVIGATIONCONTROLLER_H
#include <QObject>
#include <QQmlContext>
class NavigationItemModel;
class NavigationListModel;
class NavigationController : public QObject
{
Q_OBJECT
public:
NavigationController(QObject *parent = Q_NULLPTR);
void init(const QString & rootPath);
void setContext(QQmlContext* context);
private:
void setContextProperties();
void add(const QString & path, NavigationItemModel* parentItem);
NavigationItemModel* mRootItem;
NavigationListModel* mNavList;
QString mRootPath = ".";
QQmlContext* mContext = Q_NULLPTR;
private slots:
void onNavigationRequest();
};
#endif // NAVIGATIONCONTROLLER_H