-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.qml
38 lines (34 loc) · 856 Bytes
/
main.qml
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
34
35
36
37
38
import QtQuick 2.3
import QtQuick.Controls 1.2
ApplicationWindow {
id: window
visible: true
width: 640
height: 480
title: qsTr("Hello QML")
signal menuClicked(string str)
menuBar: MenuBar {
Menu {
title: qsTr("File")
MenuItem {
text: qsTr("Exit")
shortcut: "Ctrl+Q"
onTriggered: Qt.quit()
}
MenuItem {
text: qsTr("Click Me!")
onTriggered: window.menuClicked(text)
}
}
}
Text {
id: hw
text: qsTr("Hello World")
font.capitalization: Font.AllUppercase
anchors.centerIn: parent
}
Label {
anchors { bottom: hw.top; bottomMargin: 5; horizontalCenter: hw.horizontalCenter }
text: qsTr("Hello Qt Quick")
}
}