ViewSolutions
Loading...
Searching...
No Matches
ViewSolutions::iModel Class Referenceabstract

The iModel class is base model for GUI models. Works with ModelStorage. All models after adding can get access to any othe models that located on same storage object. More...

#include <imodel.h>

Public Member Functions

 iModel ()=default
 
virtual ~iModel ()=default
 
virtual QString modelId () const =0
 modelId returns text model id. override this method to provide access to model in qml or other models.
 
const QWeakPointer< ModelStorage > & storage () const
 storage returns storage object. this method return context of the model's storage.
 
QQmlApplicationEngine * engine () const
 engine returns qml engine.
 

Protected Member Functions

virtual void initStorage (const QWeakPointer< ModelStorage > &newStorage)
 initStorage This method is called by storage object after adding model to storage.
 

Friends

class ModelStorage
 

Detailed Description

The iModel class is base model for GUI models. Works with ModelStorage. All models after adding can get access to any othe models that located on same storage object.

Definition at line 25 of file imodel.h.

Inheritance diagram for ViewSolutions::iModel:
Inheritance graph
Collaboration diagram for ViewSolutions::iModel:
Collaboration graph

Constructor & Destructor Documentation

◆ iModel()

ViewSolutions::iModel::iModel ( )
default

◆ ~iModel()

virtual ViewSolutions::iModel::~iModel ( )
virtualdefault

Member Function Documentation

◆ engine()

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

engine returns qml engine.

Returns
qml engine.
Note
can be return nullptr if the models system initialized without qml engine.
this method convert weak pointer to shared pointer, so you can use it without any restrictions, but it may be slowly then dirrect access.

Definition at line 19 of file imodel.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initStorage()

void ViewSolutions::iModel::initStorage ( const QWeakPointer< ModelStorage > &  newStorage)
protectedvirtual

initStorage This method is called by storage object after adding model to storage.

Parameters
newStorageis storage object.

Definition at line 27 of file imodel.cpp.

◆ modelId()

virtual QString ViewSolutions::iModel::modelId ( ) const
pure virtual

modelId returns text model id. override this method to provide access to model in qml or other models.

Returns
model id.

Implemented in ViewSolutions::iGUITokensModel, and ViewSolutions::QMLColorPicker.

◆ storage()

const QWeakPointer< ModelStorage > & ViewSolutions::iModel::storage ( ) const

storage returns storage object. this method return context of the model's storage.

Returns
storage object.

Definition at line 15 of file imodel.cpp.

Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ ModelStorage

friend class ModelStorage
friend

Definition at line 65 of file imodel.h.


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