-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.qml
53 lines (48 loc) · 1.71 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
import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import QtMultimedia 6.4
import QtQml.WorkerScript 6.4
ApplicationWindow {
visible: true
width: Screen.width
height: Screen.height
GridLayout {
id: gridLayout
width: parent.width
height: parent.height
columns: gridCols
rows: gridRows
Repeater {
model: numberOfStreams
Rectangle {
color: "black"
Layout.fillWidth: true
Layout.fillHeight: true
Image {
id: opencvImage
anchors.fill: parent
fillMode: Image.Stretch // Make sure fillMode is set correctly
source: "image://live_" + model.index + "/" + model.index
cache: false
property var provider: liveImageProviders[index]
Component.onCompleted: {
if (provider) {
console.log("Connecting to image provider for index:", index);
provider.imageChanged.connect(reload);
//provider.ready.connect(onReady);
} else {
console.error("Image provider not found for index:", index);
}
}
//function onReady() {
// provider.ready = true;
//}
function reload() {
source = "image://live_" + index + "/" + index + "?timestamp=" + Date.now();
}
}
}
}
}
}