|
ViewSolutions 1.0.100.30ae2aa
View solutions of qml for quasarapp projects
|
The ModelStorage class is the main model storage object. More...
#include <modelstorage.h>


Public Member Functions | |
| ModelStorage (QQmlEngine *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 |
| get returns a typed shared pointer to the model with the given id. | |
| QQmlEngine * | engine () const |
| engine returns context qml engine. | |
The ModelStorage class is the main model storage object.
It provides access to all models in the application. Models that are added to the storage get access to the QML engine and can find any other model that is located in the same storage.
Example:
In QML the storage is available as the modelsStorage context property (set by ViewSolutions::init):
Definition at line 45 of file modelstorage.h.
| ViewSolutions::ModelStorage::ModelStorage | ( | QQmlEngine * | engine = nullptr | ) |
| bool ViewSolutions::ModelStorage::addModel | ( | const QSharedPointer< iModel > & | model | ) |
addModel adds new model into storage.
| model | is model object. |
Definition at line 19 of file modelstorage.cpp.
| QQmlEngine * ViewSolutions::ModelStorage::engine | ( | ) | const |
engine returns context qml engine.
Definition at line 38 of file modelstorage.cpp.

|
inline |
get returns a typed shared pointer to the model with the given id.
| Type | is the expected type of the model. |
| modeId | is the id of the required model. |
Definition at line 74 of file modelstorage.h.

| QObject * ViewSolutions::ModelStorage::getModel | ( | const QString & | modeId | ) | const |
getModel This method isible on The QML and using for gettings required GUI models.
| modeId | This is id of required model. |
Definition at line 34 of file modelstorage.cpp.
