Last active
August 29, 2015 14:04
-
-
Save lomedil/78088d2731856dab2ac0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// define plain JS object list | |
property var model: [ | |
{ title: qsTr("Airplane"), descr: qsTr("Some descr 1") }, | |
{ title: qsTr("Car"), descr: qsTr("Some descr 2") }, | |
{ title: qsTr("Credit Card"), descr: qsTr("Some descr 3") } | |
] | |
ListView { | |
model: root.model | |
delegate: Rectangle { | |
height: 20 | |
// cross operability with ListModel and plain JS object list | |
property var item: model.modelData ? model.modelData : model | |
Text { text: item.title + " " + item.descr } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment