Warning, /webapps/qmlonline/qml/examples/textformat.qml is written in an unsupported language. File is not indexed.

0001 import QtQuick 2.14
0002 import QtQml.Models 2.12
0003 
0004 TextEdit {
0005     property var source: "https://raw.githubusercontent.com/patrickelectric/qmlonline/master/README.md"
0006     anchors.fill: parent
0007     textFormat: TextEdit.MarkdownText
0008     Component.onCompleted: getText(source, function(result) {
0009         text = result
0010     })
0011 
0012     function getText(url, callback) {
0013         var xmlhttp = new XMLHttpRequest();
0014         xmlhttp.onreadystatechange = function() {
0015             if (xmlhttp.readyState == XMLHttpRequest.DONE && xmlhttp.status == 200) {
0016                 callback(xmlhttp.responseText)
0017             }
0018         }
0019         xmlhttp.open("GET", url, true);
0020         xmlhttp.send();
0021     }
0022 }