MyApp in first example that you’ve posted, doesn’t know what dialog is. You can pass dialog as property and connect to its signal using Connections:
MyApp {
id: app
property Dialog dialog
Connections{
target: dialog
onDone: {
console.log("done")
}
}
}
In second example, when adding handler to signal, dont use “()”, right syntax is:
MyApp {
id: app
signal ready()
onReady: {
//Javascript here
}
}
I suggest you to go through examples that can be found in Qt SDK, you can find a lot from them.
↧