blob: 2dd2cd8e21c1924e4e9464f0d34db756cb46492e (
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
import QtQuick 2.15
Item {
component First : Item {
Item {
id: a
}
states: [
State {
name: "test1"
PropertyChanges {
a.enabled: false
}
}
]
}
component Second : Item {
QtObject {
id: a
property bool enabled: true
}
states: [
State {
name: "test2"
PropertyChanges {
a.enabled: false
}
}
]
property Component cc: Item {
Item { id: a }
states: [
State {
name: "test3"
PropertyChanges {
a.enabled: false
}
}
]
}
}
First { id: first }
Second { id: second }
property Item third: second.cc.createObject();
Component.onCompleted: {
console.log(1, first.data[0].enabled, second.data[0].enabled, third.data[0].enabled);
first.state = "test1";
console.log(2, first.data[0].enabled, second.data[0].enabled, third.data[0].enabled);
second.state = "test2";
console.log(3, first.data[0].enabled, second.data[0].enabled, third.data[0].enabled);
third.state = "test3";
console.log(4, first.data[0].enabled, second.data[0].enabled, third.data[0].enabled);
}
}
|