status-desktop/src-cpp/app/modules/main/view.h

37 lines
838 B
C
Raw Normal View History

#pragma once
2022-01-20 14:48:57 +00:00
#include <QObject>
#include <memory>
2022-01-20 14:48:57 +00:00
#include "../shared/section_model.h"
2022-01-20 14:48:57 +00:00
namespace Modules::Main
{
2022-01-20 14:48:57 +00:00
class View : public QObject
{
Q_OBJECT
Q_PROPERTY(Shared::Models::SectionModel* sectionsModel READ getSectionsModel NOTIFY sectionsModelChanged)
Q_PROPERTY(Shared::Models::SectionItem* activeSection READ getActiveSection NOTIFY activeSectionChanged)
2022-01-20 14:48:57 +00:00
public:
using QObject::QObject;
void load();
void addItem(Shared::Models::SectionItem* item);
void setActiveSection(const QString& Id);
signals:
void viewLoaded();
void sectionsModelChanged();
void activeSectionChanged();
private:
Shared::Models::SectionModel* getSectionsModel();
Shared::Models::SectionItem* getActiveSection() const;
Shared::Models::SectionModel m_sectionModel;
2022-01-20 14:48:57 +00:00
};
} // namespace Modules::Main