How to set dynamically created component to the Loader.
QML and Qt Quick
1
Posts
1
Posters
1.3k
Views
1
Watching
-
wrote on 2 Nov 2011, 09:46 last edited by
I am creating new QML screen using following code.
@
var newComp = Qt.createComponent("test.qml");
var newObject = newComp.createObject(parent, {"x": 0, "y": 0});
@I wan to set this component to the loader.
I have tried to do it using "Loader.sourceComponent = newObject;" it works but it gives me following error."Error: Cannot assign QObject* to QDeclarativeComponent*"
Is there any workaround for this.
Thanks.
[EDIT: code formatting, Volker]
1/1