diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-04-19 06:20:56 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-04-19 06:33:25 (GMT) |
commit | 2a9a22c7464b706c1e1998e10910b8f99528c6c4 (patch) | |
tree | a1dba550718952350c6a780da0f7db0eb0cc70ea /tests/auto/declarative/qdeclarativelistmodel/data | |
parent | b13def0486a083c48bae40dab2bac014b690f36d (diff) | |
download | Qt-2a9a22c7464b706c1e1998e10910b8f99528c6c4.zip Qt-2a9a22c7464b706c1e1998e10910b8f99528c6c4.tar.gz Qt-2a9a22c7464b706c1e1998e10910b8f99528c6c4.tar.bz2 |
Test that ListElements returned by get() can be iterated over in JS.
Task-number: QTBUG-9420
Diffstat (limited to 'tests/auto/declarative/qdeclarativelistmodel/data')
-rw-r--r-- | tests/auto/declarative/qdeclarativelistmodel/data/enumerate.qml | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativelistmodel/data/enumerate.qml b/tests/auto/declarative/qdeclarativelistmodel/data/enumerate.qml new file mode 100644 index 0000000..8d23d4b --- /dev/null +++ b/tests/auto/declarative/qdeclarativelistmodel/data/enumerate.qml @@ -0,0 +1,24 @@ +import Qt 4.6 + +Item { + property string result + + ListModel { + id: model + + ListElement { + val1: 1 + val2: 2 + val3: "str" + val4: false + val5: true + } + } + + Component.onCompleted: { + var element = model.get(0); + + for (var i in element) + result += i+"="+element[i]+(element[i] ? "Y" : "N")+":"; + } +} |