-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.qml
48 lines (41 loc) · 984 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
39
40
41
42
43
44
45
46
47
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Window 2.2
import QtQuick.Dialogs 1.2
ApplicationWindow {
title: qsTr("Time Tracker")
width: 640
height: 300
visible: true
menuBar: MenuBar {
Menu {
title: qsTr("&File")
MenuItem {
text: qsTr("&Open")
onTriggered: messageDialog.show(qsTr("Open action triggered"));
}
MenuItem {
text: qsTr("E&xit")
onTriggered: Qt.quit();
}
}
}
MainForm {
anchors.fill: parent
Keys.onPressed: {
switch (event.key) {
case Qt.Key_Escape:
Qt.quit();
break;
}
}
}
MessageDialog {
id: messageDialog
title: qsTr("Notification")
function show(caption) {
messageDialog.text = caption;
messageDialog.open();
}
}
}