ViewSolutions
Loading...
Searching...
No Matches
ViewSolutions::ModelStorage Class Reference

The ModelStorage class main model storage object. Provide access to all models in the application. More...

#include <modelstorage.h>

Public Member Functions

 ModelStorage (QQmlApplicationEngine *engine=nullptr)
 
bool addModel (const QSharedPointer< iModel > &model)
 addModel adds new model into storage.
 
Q_INVOKABLE QObject * getModel (const QString &modeId) const
 getModel This method isible on The QML and using for gettings required GUI models.
 
template<class Type >
QSharedPointer< Type > get (const QString &modeId) const
 
QQmlApplicationEngine * engine () const
 engine returns context qml engine.
 

Detailed Description

The ModelStorage class main model storage object. Provide access to all models in the application.

Definition at line 22 of file modelstorage.h.

Inheritance diagram for ViewSolutions::ModelStorage:
Inheritance graph
Collaboration diagram for ViewSolutions::ModelStorage:
Collaboration graph

Constructor & Destructor Documentation

◆ ModelStorage()

ViewSolutions::ModelStorage::ModelStorage ( QQmlApplicationEngine *  engine = nullptr)

Definition at line 14 of file modelstorage.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ addModel()

bool ViewSolutions::ModelStorage::addModel ( const QSharedPointer< iModel > &  model)

addModel adds new model into storage.

Parameters
modelis model object.
Returns
true if model added succesfful, if model alredy exists or model is invalid return false.
Note
All valid models should be inherited from QObject, and inited using a QSharedPointer::create() method.

Definition at line 19 of file modelstorage.cpp.

◆ engine()

QQmlApplicationEngine * ViewSolutions::ModelStorage::engine ( ) const

engine returns context qml engine.

Returns
qml engine.

Definition at line 38 of file modelstorage.cpp.

Here is the caller graph for this function:

◆ get()

template<class Type >
QSharedPointer< Type > ViewSolutions::ModelStorage::get ( const QString &  modeId) const
inline

Definition at line 44 of file modelstorage.h.

◆ getModel()

QObject * ViewSolutions::ModelStorage::getModel ( const QString &  modeId) const

getModel This method isible on The QML and using for gettings required GUI models.

Parameters
modeIdThis is id of required model.
Returns
model raw pointer.

Definition at line 34 of file modelstorage.cpp.


The documentation for this class was generated from the following files: