Component Destruction
Moved
Solved
QML and Qt Quick
-
Hi,
When Load a component using Loader I can delete the component when I dont need more in the application changing the value of property source to ""
Example:
//Component.qml Component { Rectangke{....} } //Main.qml Window { Button{ text: "Load" onClicked: loader.source = "Component.qml" } Button{ text: "Close" onClicked: loader.source = "" } Loader{ id: loader } }
My problem occurs when instead of use Loader I use as show bellow:
//Main.qml Window { Component { ..... } }
Using this option I dont know how can I load and delete the component when I need.
-
You can create it dynamically by calling
createObject
and destroy when needed viadestroy
. More info can be found here. -
@IntruderExcluder Thank you so much !