Well for me the easy way is this, but everybody has their own:
// from memory, sorry for any errors
QQuickView *view = new QQuickView();
MainWindowMC *mainMC = new MainWindowMC();
view->rootContext()->setCOntextProperty("myMain", mainMC);
view->setSource(QUrl::fromUserInput("myQml.qml"));
view->show();
return app.exec();
↧