summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/animations/data/attached.qml
blob: 0fb6f8cbca9bf03058f754caeb0ae53dd58d8c28 (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
import Qt 4.6

Rectangle {
    width: 180; height: 200;

    Component {
        id: delegate
        Rectangle {
            id: wrapper
            width: 180; height: 200
            color: "blue"

            states: State {
                name: "otherState"
                PropertyChanges { target: wrapper; color: "green" }
            }

            transitions: Transition {
                PropertyAction { target: wrapper; property: "ListView.delayRemove"; value: true }
                ScriptAction { script: console.log(ListView.delayRemove ? "on" : "off") }
            }

            Component.onCompleted: {
                console.log(ListView.delayRemove ? "on" : "off");
                wrapper.state = "otherState"
            }
        }
    }

    ListView {
        model: 1
        delegate: delegate
    }
}