Debian Codegraph @

tests/auto/qml/qqmllistmodel/data/bindingsOnGetResult.qml

raw
1 import QtQuick 2.0
2
3 QtObject {
4 property ListModel model: ListModel {
5 ListElement { modified: false }
6 ListElement { modified: false }
7 ListElement { modified: false }
8 ListElement { modified: false }
9 ListElement { modified: false }
10 }
11
12 property bool isModified: {
13 for (var i = 0; i < model.count; ++i) {
14 if (model.get(i).modified)
15 return true;
16 }
17 return false;
18 }
19
20 property bool success: false
21 Component.onCompleted: {
22 // trigger read and setup of property captures
23 success = isModified
24 model.setProperty(0, "modified", true)
25 success = isModified
26 }
27 }