I’m missing big parts of your code. Next time please place your code between at-sign characters (most right icon on the top)
I do not quite understand what your trying to do, but as far as I know putting JavaScript code in the component does not work. You may put them in the attached property Component.onCompleted.
Loader {
id: cmpntLoader
Component{
id: dialogComponent
property int slotNum // I expect you have something like this too
Component.onCompleted: {
var component = Qt.createComponent("BrandPopup.qml");
if (component.status === Component.Ready) {
component.createObject(main, {"slot":slotNum});
}
}
}
Maybe it would help if you give a more complete example of your code to show what you try to do.
↧