How to terminate or hide a qml using loader
-
wrote on 27 Oct 2011, 12:54 last edited by
is there a way how to terminate or hide an opened qml, just like in other PL's, like in visual basic, there are commands wherein a qml is just like a form, that is when a button is clicked a new form will be shown and the previous form will be hide or will be close, just like the Me.hide command,
-
wrote on 27 Oct 2011, 13:13 last edited by
QML is not like a VB application that you can open or hide a window. you can hide any object in qml using .visible=false
your windows can be something like components in QML. -
wrote on 27 Oct 2011, 13:33 last edited by
ahh ok, just checking if theres a way on terminating a qml just like a vb application :),
Thank you sir
-
wrote on 27 Oct 2011, 14:55 last edited by
for closing the whole application (+QML viewer) you may use Qt.quit()
-
wrote on 29 Oct 2011, 18:25 last edited by
If you use a Loader item then you can unload the item by setting the Loader's source property to undefined. This will free the allocated resources for that item.
-
wrote on 31 Oct 2011, 13:32 last edited by
how can i make the source undefined? can you please give me a sample code for that line?
-
wrote on 31 Oct 2011, 13:50 last edited by
Something like this should do it:
@
Loader {
id: myLoader
source: "MyComponent.qml"
}...
MouseArea {
onClicked: myLoader.source = undefined
}
@ -
wrote on 1 Nov 2011, 15:03 last edited by
Thank you sir, ill try it in my project
-
wrote on 2 Nov 2011, 16:43 last edited by
you can also use
@myLoader.source = ""@
7/9