Ubuntu Pastebin

Paste from Albert Astals Cid at Mon, 4 Apr 2016 13:00:37 +0000

Download as text
 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
import QtQuick 2.4

Item {
    ListModel {
        id: theModel
        ListElement {
            value: "45"
        }
    }

    ListView {
        height: 40
        id: list1
        model: theModel
        delegate: Text {
            text: modelData
        }
    }


    ListView {
        anchors.top: list1.bottom
        model: theModel
        delegate: Text {
            text: value
        }
    }

    Timer {
        interval: 2000
        running: true
        onTriggered: {
            console.log("Setting new value");
            theModel.setProperty(0, "value", "46");
        }
    }
}
Download as text