Hi,
I would like to build and integrate a Qml interface into a QMainWindow. I generate a QmlView, set the Url to a simple helloWorld component and set the QmlView as the central widget of QMainWindow:
QMainWindow window;
QmlView *view = new QmlView( this );
QUrl url = QUrl::fromLocalFile("helloWorld.qml");
view->setUrl(url);
window->setCentralWidget( view );
This works fine. Now how would I do this if I have a main component "ListView.qml" which uses the component "Cell.qml". I tried it via QmlComponent as following but get the error that the type "Cell" is not available in ListView.qml.
QmlComponent list(engine, "ListView.qml" );
list.create();
QmlComponent cell(engine, "Cell.qml" );
cell.create();
Really happy for any hints what I am doing wrong.