ok I solved without knowing it.
the data is from this javascript function.
in the dialog was enough for me to do so:
Text {
anchors.centerIn: parent
text: "AUTORE: " + author + "\n" + "EDITORE: " + editor
}
this is the javascript function, and is called in the main.qml
function load() {
listModelJson.clear();
var xhr = new XMLHttpRequest();
xhr.open("GET","http://www.sito.com/file.php", true);
xhr.onreadystatechange = function() {
if (xhr.readyState == xhr.DONE) {
if (xhr.status == 200) {
var jsonObject = JSON.parse(xhr.responseText);
for (var i in jsonObject) {
listModelJson.append({
"title" : jsonObject[i].title,
"author" : jsonObject[i].author,
"editor" : jsonObject[i].editor
});
}
}
}
}
xhr.send();
}
thanks!!
↧