Wednesday, September 25, 2013

Hello Qt Quick 2 UI with Controls

It's the Qt Creator auto-generated Qt Quick 2 UI with Controls.

Hello Qt Quick 2 UI with Controls
Hello Qt Quick 2 UI with Controls


import QtQuick 2.1
import QtQuick.Controls 1.0
import QtQuick.Window 2.0

ApplicationWindow {
    title: qsTr("Hello World")
    width: 640
    height: 480

    menuBar: MenuBar {
        Menu {
            title: qsTr("File")
            MenuItem {
                text: qsTr("Exit")
                onTriggered: Qt.quit();
            }
        }
    }

    Button {
        text: qsTr("Hello World")
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.verticalCenter: parent.verticalCenter
    }
}