summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeanimations/data/attached.qml
blob: 78949f903d1286d0eac9193c74f71d22cf454d16 (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.7

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
    }
}