Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
var component = Qt.createComponent("SplashScreen.qml"); var obj = component.createObject(parent); if(obj === null) { obj.finished.connect(showHomePage); }
In the official example, no destroy.
@crawl-w Hi,
Using destroy(). The doc of createObject() say:
destroy()
createObject()
Dynamically created instances can be deleted with the destroy() method. See Dynamic QML Object Creation from JavaScript for more information.
@gojir4 What you are saying is obj not component in the example code. obj is instance of component.
obj
component
The JavaScript engine will indeed take ownership of the object created by Qt.createComponentObject. This is not documented specifically because in general, any object returned by a JavaScript function is normally managed by the garbage collector.