15 QQmlEngine::setObjectOwnership(
this, QQmlEngine::CppOwnership);
20 if (_storage.contains(model->modelId())) {
24 if (QObject* qobject =
dynamic_cast<QObject*
>(model.get())) {
25 QQmlEngine::setObjectOwnership(qobject, QQmlEngine::CppOwnership);
28 _storage[model->modelId()] = model;
29 model->initStorage(sharedFromThis().toWeakRef());
35 return dynamic_cast<QObject*
>(_storage.value(modeId).get());
QQmlApplicationEngine * engine() const
engine returns context qml engine.
bool addModel(const QSharedPointer< iModel > &model)
addModel adds new model into storage.
ModelStorage(QQmlApplicationEngine *engine=nullptr)
Q_INVOKABLE QObject * getModel(const QString &modeId) const
getModel This method isible on The QML and using for gettings required GUI models.
the ViewSolutions namespace