Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QML: How to delete an objects created with Qt.createQmlObject?

Tags:

qt

qml

I have some objects created in QML code with

Qt.createQmlObject (...)

How can I delete/remove these objects?

like image 834
Knight of Ni Avatar asked Apr 15 '13 22:04

Knight of Ni


People also ask

How do you delete an object in QML?

Items can be deleted using the destroy() method. This method has an optional argument (which defaults to 0) that specifies the approximate delay in milliseconds before the object is to be destroyed. Alternatively, the application. qml could have destroyed the created object by calling object.

What is component onCompleted in QML?

Emitted after component "startup" has completed. This can be used to execute script code at startup, once the full QML environment has been established. The corresponding handler is onCompleted. It can be declared on any object. The order of running the onCompleted handlers is undefined.

What is loader in QML?

Loader is used to dynamically load QML components. Loader can load a QML file (using the source property) or a Component object (using the sourceComponent property).


1 Answers

something = Qt.createQmlObject (...);
something.destroy();
like image 125
Megamozg Avatar answered Nov 03 '22 00:11

Megamozg