-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.qml
139 lines (114 loc) · 2.94 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.0
Window {
width: Screen.width
height: Screen.height
visible: true
color: "lightblue"
title: qsTr("OpencvToQml")
Rectangle{
id: imageRect
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
width: 800
height: 600
color: "transparent"
border.color: "black"
border.width: 3
Image{
id: opencvImage
anchors.fill: parent
fillMode: Image.PreserveAspectFit
property bool counter: false
visible: false
source: "image://live/image"
asynchronous: false
cache: false
function reload()
{
counter = !counter
source = "image://live/image?id=" + counter
}
}
}
Rectangle{
id: startButton
x: imageRect.x/2 - startButton.width/2
y:imageRect.height/6 + imageRect.y
color: "white"
width: 200
height: 50
radius: 10
Text {
id: startButtonText
text: qsTr("Start")
anchors.centerIn: parent
font.bold: true
}
MouseArea{
anchors.fill: parent
onClicked: {
VideoStreamer.openVideoCamera(videoPath.text)
opencvImage.visible = true
}
}
}
TextField{
id:videoPath
x: startButton.x - startButton.width*0.5
y: startButton.y + startButton.height * 2
placeholderText: "Recording path directory"
cursorVisible: true
width: startButton.width * 2
}
Rectangle{
id: startRecordingButton
x: imageRect.x/2 - startButton.width/2
y:imageRect.height/2 + imageRect.y
color: "white"
width: 200
height: 50
radius: 10
Text {
id: startRecordingButtonText
text: qsTr("Start Recorder")
anchors.centerIn: parent
font.bold: true
}
MouseArea{
anchors.fill: parent
onClicked: {
VideoStreamer.startRecording(videoPath.text)
}
}
}
Rectangle{
id: saveButton
x: imageRect.x/2 - startButton.width/2
y:imageRect.height/1.5 + imageRect.y
color: "white"
width: 200
height: 50
radius: 10
Text {
id: saveButtonText
text: qsTr("Save")
anchors.centerIn: parent
font.bold: true
}
MouseArea{
anchors.fill: parent
onClicked: {
VideoStreamer.saveButton()
}
}
}
Connections{
target: liveImageProvider
function onImageChanged()
{
opencvImage.reload()
}
}
}