UTPassMirror/qml/models/Manifest.qml

32 lines
981 B
QML
Raw Normal View History

2019-03-15 16:53:40 +00:00
pragma Singleton
import QtQuick 2.4
Item {
2019-03-23 19:53:02 +00:00
id: manifest
property string name: ""
property string description: ""
property string architecture: ""
property string title: ""
property string version: ""
property string maintainer: ""
property string framework: ""
2019-03-22 16:40:44 +00:00
Component.onCompleted: {
2019-03-23 19:53:02 +00:00
var xhr = new XMLHttpRequest
xhr.open("GET", "../../manifest.json")
xhr.onreadystatechange = function () {
if (xhr.readyState == XMLHttpRequest.DONE) {
var mJson = JSON.parse(xhr.responseText)
manifest.name = mJson.name
manifest.description = mJson.description
manifest.architecture = mJson.architecture
manifest.title = mJson.title
manifest.version = mJson.version
manifest.maintainer = mJson.maintainer
manifest.framework = mJson.framework
}
}
xhr.send()
}
2019-03-15 16:53:40 +00:00
}