-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.qml
100 lines (86 loc) · 2.18 KB
/
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import QtQuick
import QtQuick.Controls
import QtMultimedia
import Qt.labs.platform
import QtCore
ApplicationWindow {
Settings{
property alias folder: fileDialog.folder
property alias last_file: playRecording.source
}
id: window
visible: true
width: 433
height: 150
title: qsTr("DictatumLudere")
header: ToolBar {
contentHeight: toolButton.implicitHeight
ToolButton {
id: toolButton
text: stackView.depth > 1 ? "\u25C0" : "\u2630"
font.pixelSize: Qt.application.font.pixelSize * 1.6
onClicked: {
if (stackView.depth > 1) {
stackView.pop()
} else {
drawer.open()
}
}
}
Label {
text: stackView.currentItem.title
anchors.centerIn: parent
}
}
Drawer {
id: drawer
width: window.width * 0.66
height: window.height
Column {
anchors.fill: parent
ItemDelegate{
text: qsTr("Open File")
width: parent.width
onClicked: {
fileDialog.visible = true
}
}
ItemDelegate{
text: qsTr("Quit")
width: parent.width
onClicked: {
Qt.quit()
}
}
}
}
MediaPlayer{
id: playRecording
source: ""
audioOutput: AudioOutput {
}
}
FileDialog {
id: fileDialog
title: "Please choose a file"
fileMode: FileDialog.OpenFile
onAccepted: {
console.log("You chose: " + fileDialog.file)
playRecording.source = fileDialog.file
var ok = loader.prepare(fileDialog.file)
visible = false
drawer.close()
}
onRejected: {
console.log("Canceled")
visible = false
drawer.close()
}
Component.onCompleted: visible = false
}
StackView {
id: stackView
initialItem: "Home.qml"
anchors.fill: parent
}
}