aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qtquick2/qdeclarativestates/data/Implementation/MyType.qml
blob: 01eb32cd4d505fa7ef67d048f4ada3fe7db5c19c (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
import QtQuick 2.0

Item {
    Column {
        anchors.centerIn: parent
        Image { id: image1; objectName: "image1" }
        Image { id: image2; objectName: "image2" }
        Image { id: image3; objectName: "image3" }
    }

    states: State {
        name: "SetImageState"
        PropertyChanges {
            target: image1
            source: "images/qt-logo.png"
        }
        PropertyChanges {
            target: image2
            source: "images/" + "qt-logo.png"
        }
        PropertyChanges {
            target: image3
            source: "images/" + (true ? "qt-logo.png" : "")
        }
    }

    MouseArea {
        anchors.fill: parent
        onClicked: parent.state = "SetImageState"
    }

}