aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlvaluetypes/data/conflicting.3.qml
blob: 509fb395626884359d6b01337daec142931610d5 (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
import QtQuick 2.0

Rectangle {
    id: root

    width: 800
    height: 600

    property alias font: myText.font

    property int myPixelSize: 12
    property int myPixelSize2: 24

    Text {
        id: other
        font.pixelSize: 6
    }

    Text {
        id: myText

        text: "Hello world!"
        font.pixelSize: myPixelSize
    }

    states: State {
        name: "Swapped"
        PropertyChanges {
            target: myText
            font.pixelSize: myPixelSize2
        }
    }

    function toggle() {
        if (root.state == "") root.state = "Swapped"; else root.state = "";
    }

    MouseArea {
        anchors.fill: parent
        onClicked: { if (root.state == "") root.state = "Swapped"; else root.state = "";}
    }
}