summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeanimations/data/attached.qml
blob: 5da4a69441fccea7ed1538a7b98d2c4d4e3ae37e (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 QtQuick 1.0

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