-
Notifications
You must be signed in to change notification settings - Fork 1
/
RelativeFocus.qml
82 lines (75 loc) · 1.99 KB
/
RelativeFocus.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
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import org.tal
RowLayout {
property CameraDevice cd;
GridLayout {
id: gl
Layout.fillWidth: true
Layout.alignment: Qt.AlignTop
Layout.minimumWidth: 130
Layout.minimumHeight: 120
Layout.maximumHeight: 300
rows: 3
columns: 2
Button {
text: "Focus-"
Layout.fillWidth: true
Layout.fillHeight: true
onClicked: cd.focus(-100);
}
Button {
text: "Focus+"
Layout.fillWidth: true
Layout.fillHeight: true
onClicked: cd.focus(100);
}
Button {
text: "Focus--"
Layout.fillWidth: true
Layout.fillHeight: true
onClicked: cd.focus(-500);
}
Button {
text: "Focus++"
Layout.fillWidth: true
Layout.fillHeight: true
onClicked: cd.focus(500);
}
Button {
text: "Auto Focus"
icon.name: "zoom-fit-best"
onClicked: cd.autoFocus()
Layout.fillHeight: true
Layout.fillWidth: true
Layout.minimumWidth: 100
Layout.columnSpan: 2
}
}
Dial {
id: focusDial
inputMode: Dial.Horizontal
Layout.fillHeight: true
Layout.fillWidth: true
Layout.minimumWidth: 180
Layout.preferredWidth: 200
from: -200
to: 200
stepSize: 10
onValueChanged: console.debug(value)
onPressedChanged: if (!pressed) value=0
wheelEnabled: true
Timer {
interval: 200
repeat: true
running: focusDial.pressed || focusDial.value!=0
onTriggered: {
console.debug("RelFocus: "+focusDial.value)
if (focusDial.value==0)
return;
cd.focus(focusDial.value);
}
}
}
}