blob: 8fe47b72961ea832dfb16968ed2420d56728766c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
import QtQuick
Item {
id: root
visible: true
property var speaker
signal say_hello()
Component{
id: speakerComp
Text {
text: "HELLO"
function say_hello() {
console.log(text)
}
}
}
Timer {
interval: 1; running: true; repeat: false
onTriggered: root.say_hello();
}
Component.onCompleted:
{
root.speaker = speakerComp.createObject(root);
root.say_hello.connect(root.speaker.say_hello);
root.speaker.destroy();
}
}
|