import Qt 4.7 Rectangle { width: 360 height: 360 id: screen property string addText: "" Text { id: textDisplay anchors.centerIn: parent text: "Status code: " + parent.addText } Component.onCompleted: { var url = 'https://maemo.org/' var xhr = new XMLHttpRequest; xhr.open("GET", url); xhr.onreadystatechange = function() { if (xhr.readyState == XMLHttpRequest.DONE) { screen.addText = xhr.status } } xhr.send(); } }