Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qdeclarativelistmodel / data / setmodelcachelist.qml
1 import QtQuick 1.0
2
3 ListModel {
4     id: model
5     property bool ok : false
6
7     Component.onCompleted: {
8         model.append({"attrs": []})
9         model.get(0)
10         model.set(0, {"attrs": [{'abc': 123, 'def': 456}] } )
11         ok = ( model.get(0).attrs.get(0).abc == 123
12             && model.get(0).attrs.get(0).def == 456 )
13
14         model.set(0, {"attrs": [{'abc': 789, 'def': 101}] } )
15         ok = ( model.get(0).attrs.get(0).abc == 789
16             && model.get(0).attrs.get(0).def == 101 )
17
18     }
19 }
20