aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllistmodel/data/bindingsOnGetResult.qml
blob: 6bf750dcda2c230699690a80a816007fb574a5d0 (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
import QtQuick 2.0

QtObject {
    property ListModel model: ListModel {
        ListElement { modified: false }
        ListElement { modified: false }
        ListElement { modified: false }
        ListElement { modified: false }
        ListElement { modified: false }
    }

    property bool isModified: {
        for (var i = 0; i < model.count; ++i) {
            if (model.get(i).modified)
                return true;
        }
        return false;
    }

    property bool success: false
    Component.onCompleted: {
        // trigger read and setup of property captures
        success = isModified
        model.setProperty(0, "modified", true)
        success = isModified
    }
}