Hi guys think I have solved this for anyone else looking to do it.
QGuiApplication app( argc, argv );
QQuickWindow window;
QQmlEngine engine;
QQmlComponent component(&engine, QUrl::fromLocalFile(QLatin1String("qml/main.qml")));
QQuickItem *item = qobject_cast<QQuickItem*>(component.create());
item->setParentItem(window.contentItem());
qDebug() << item;
window.show();
return app.exec()
you cast back to a qquickitem and set our window as the parent like so.
Thanks again zapB
↧