I have loaded MyItem.qml as a source component onto Loader element. Now i want to remove or unload that page from Loader element. I tried to set source : "" & sourceComponent : "" , also sourceComponent : "undefined". But it did not work
You should set sourceComponent = undefined
or source = ""
.
Usually, I use this code:
Loader{
id: loader
function show(component) {
sourceComponent = component;
}
function hide(){
sourceComponent = undefined;
}
}
You can just set the active
property to false
for unload or true
(default) for loading.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With