Unsolved Dynamic object destroy
-
Hey,
I have a button which creates a box dynamically which I've done like the Qt Document: Dynamic QML Object Creation from JavaScript suggests.
function createObject() { var comp = Qt.createComponent("Box.qml") var box = comp.createObject(parent) }
Now, I need function which removes the created object but I am unable to access it. I can't figure out how to do that based on that Qt document and I haven't found any other references either.
So could somebody please let me know, how this can be achieved?
-
@The-Smiling-Mickey
You mean like in http://doc.qt.io/qt-5/qtqml-javascript-dynamicobjectcreation.html (same page as you mention), section Deleting Objects Dynamically , thedestroy()
method? -
Right, I thought twice about mentioning the destroy() method but I thought it was obvious that it needs to be used.
The question is how I need to use it outside the function, I wrote, so it actually removes what it needs to?
-
Well, thanks for all the help I guess.