ViewSolutions
Loading...
Searching...
No Matches
imodel.cpp
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#include "imodel.h"
9
10#include <modelstorage.h>
11
12namespace ViewSolutions {
13
14
15const QWeakPointer<ModelStorage> &iModel::storage() const {
16 return m_storage;
17}
18
19QQmlApplicationEngine *iModel::engine() const {
20 if (auto&& storage = m_storage.lock()) {
21 return storage->engine();
22 }
23
24 return nullptr;
25}
26
27void iModel::initStorage(const QWeakPointer<ModelStorage> &newStorage) {
28 m_storage = newStorage;
29}
30}
QQmlApplicationEngine * engine() const
engine returns qml engine.
Definition imodel.cpp:19
virtual void initStorage(const QWeakPointer< ModelStorage > &newStorage)
initStorage This method is called by storage object after adding model to storage.
Definition imodel.cpp:27
const QWeakPointer< ModelStorage > & storage() const
storage returns storage object. this method return context of the model's storage.
Definition imodel.cpp:15
the ViewSolutions namespace