-
Suggestion
-
Resolution: Unresolved
-
P2: Important
-
4.7.0, 5.0.0
It would be very convenient to have a JSON data model to use with QML's list view elements, instead of emulating a model using XMLHttpRequest, regular JavaScript JSON support and ListModel. For example,
Item {
ListModel { id: listmodel }
onCompleted: {
var xhr = new XMLHttpRequest;
xhr.open("GET", "http://service.com/api");
xhr.onreadystatechange = function() {
if (xhr.readyState == XMLHttpRequest.DONE) {
var a = JSON.parse(xhr.responseText);
for (var b in a) {
var o = a[b];
listmodel.append({name: o.name, url: o.url});
}
}
}
xhr.send();
}
}
- depends on
-
QTBUG-21844 Support bindable JavaScript objects
-
- Open
-
- is duplicated by
-
QTBUG-84107 Using object list (array) as a model unable to track changes
-
- Closed
-
- relates to
-
QTBUG-35891 [Regression] Crash when appending to ListModel
-
- Closed
-
-
QTBUG-79342 Allow binding to members of JavaScript objects and arrays
-
- Open
-
-
QTBUG-111830 Let's add a QAbstractItemModel to display JSON data
-
- Reported
-
-
QTBUG-14986 Full array support for QML list properties (and variant properties that contain lists)
-
- Closed
-
-
QTBUG-12761 JSON parsing
-
- Closed
-
- replaces
-
QTBUG-38403 QList Cannot Be Used as Model in QML
-
- Closed
-