In my application QMLApplicationViewer is initialized with some properties in the main.cpp & then the relevant qml is activated.
Now i am passing the reference of the QMLApplicationViewer(from main.cpp) in some other class also which is derived from QDeclarativeView. Now my application needs to loads a particular view(QML) at some instance & for that i am calling a function from QML in this same class inside which the new QML is loaded using the same of instance of QMLApplicationViewer:
class soemclass: public QObject
explicit soemclass( QDeclarativeView *view,QObject *parent = 0); , this is called from main & takes the QMLApplicationViewer reference.
soemclass::soemclass(QDeclarativeView *view,QObject *parent) :
// this saves the instance of QMLApplicationViewer in main_view
void soemclass::LoadNewQml() // this is called from QML to load new QML
Now everytime my application needs to load a new QML, i am calling the above function.
Also i cannot call a particluar QML from other QML as my application needs to loads some data before the QML is loaded, so i am using the above approach.
So what i need to know is , would there be any problem if i use the above approach for loading the new QML's using the same instance of QMLApplicationViewer?