一个简单的应用程序在窗口中心显示文本“ Hello World”。
import QtQuick 2.3
importQtQuick.Window2.0
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World") //qsTr()方法用于从一种语言到另一种语言的翻译。
Text {
text: qsTr("Hello World")
anchors.centerIn: parent
}
}