ViewSolutions
Loading...
Searching...
No Matches
imodel.h
Go to the documentation of this file.
1//#
2//# Copyright (C) 2020-2025 QuasarApp.
3//# Distributed under the GPLv3 software license, see the accompanying
4//# Everyone is permitted to copy and distribute verbatim copies
5//# of this license document, but changing it is not allowed.
6//#
7
8#ifndef IMODEL_H
9#define IMODEL_H
10
11#include <QQmlApplicationEngine>
12#include <QString>
13#include <QWeakPointer>
15
16
17namespace ViewSolutions {
18
19class ModelStorage;
20
26{
27public:
28 iModel() = default;
29 virtual ~iModel() = default;
30
35 virtual QString modelId() const = 0;
36
41 const QWeakPointer<ModelStorage>& storage() const;
42
51 QQmlApplicationEngine * engine() const;
52
53protected:
54
59 virtual void initStorage(const QWeakPointer<ModelStorage>& newStorage);
60
61private:
62
63 QWeakPointer<ModelStorage> m_storage;
64
65 friend class ModelStorage;
66};
67
68}
69#endif // IMODEL_H
The ModelStorage class main model storage object. Provide access to all models in the application.
The iModel class is base model for GUI models. Works with ModelStorage. All models after adding can g...
Definition imodel.h:26
virtual QString modelId() const =0
modelId returns text model id. override this method to provide access to model in qml or other models...
virtual ~iModel()=default
the ViewSolutions namespace
#define VIEWSOLUTION_EXPORT