main.qml 715 字节
Newer Older
P
peterq 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
import QtQuick 2.1
import QtQuick.Window 2.0
import "js/util.js" as Util

Window {
    visible: true
    width: 360
    height: 360

    MouseArea {
        anchors.fill: parent
        onClicked: {
            Qt.quit()
        }
    }

    Text {
        id: text
        text: "hello pan-light"
        anchors.centerIn: parent
    }

    Component.onCompleted: {
        // 初始化js工具
        Util.callGoAsync('wait', {
                             "time": 3
                         }).then(function (s) {
                             text.text = s + Util.callGoSync('time')
                         }, null, function (s) {
                             text.text = s
                         })
    }
}