-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFaceInfoPanel.qml
111 lines (92 loc) · 2.35 KB
/
FaceInfoPanel.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
import QtQuick 2.7
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.2
import FaceService 1.0
Rectangle {
id: root
// color: "green"
Rectangle{
id: previewRc
anchors.centerIn: parent
width: 360
height: 360
// color: "red"
Loader{
id: cameraLoader
}
}
Rectangle{
id: btnRc
anchors.top: previewRc.bottom
anchors.topMargin: 20
width: root.width
RowLayout{
anchors.centerIn: parent
spacing: 6
Button{
width: 120
height: 32
text: "识别"
// color: "blue"
onClicked: {
}
}
Button{
width: 120
height: 32
text: "添加"
// color: "yellow"
onClicked: {
}
}
Button{
width: 120
height: 32
text: "保存"
// color: "yellow"
onClicked: {
FaceService.save()
}
}
}
}
Rectangle{
anchors.top: btnRc.bottom
anchors.topMargin: 30
width: 30
TextEdit{
id: faceid
anchors.fill: parent
}
}
Component.onCompleted: {
cameraLoader.source = "CameraItem.qml"
if (cameraLoader.Error == Loader.Error){
console.log("load camera item error")
return
}
if (cameraLoader.item){
cameraLoader.item.sizeChanged.connect(updateRootSize)
// cameraLoader.item.parent = camerawWin
cameraLoader.item.width = previewRc.width
cameraLoader.item.height = previewRc.height
if (camerawWin.autoStart)
camerawWin.start()
}
}
function start() {
if (cameraLoader.item) {
cameraLoader.item.start()
camerawWin.started = true
}
}
function stop() {
if (cameraLoader.item) {
cameraLoader.item.stop()
camerawWin.started = false
}
}
function contentItem() { return cameraLoader.item }
function updateRootSize() { previewRc.height = contentItem().height }
}