-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.qml
126 lines (124 loc) · 4.1 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
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.3
ApplicationWindow {
visible: true
width: 1000
height: 900
title: "Example to use"
RowLayout {
anchors.fill: parent
ColumnLayout {
Layout.alignment: Qt.AlignHCenter
spacing: 10
Item {
height: 75
width: 600
Text {
text: "exhibit (not all functionality is implemented in the example! see control code)"
anchors.top: parent.top
anchors.left: parent.left
anchors.leftMargin: 10
height: 15
}
Rectangle {
border.width: 1
border.color: "black"
anchors.fill: parent
anchors.topMargin: 15
NumBox {
id: superRealSpinBox
height: 45
width: 200
value: 0.0
precision: precision_setter.value
minimumValue: 0.0
maximumValue: 104.75
enableSequenceGrid: chkEnableSeqGrid.checked
step: step_setter.value
editable: chkEditable.checked
suffix: " dB"
fixed: chkFixedZeros.checked
decimalPlaces: decimals_setter.value
memory: 3.8
doubleClickEdit: chk2click.checked
onFinishEdit: {
value = number; // if you don't write that, nothing will change!
}
anchors.centerIn: parent
}
}
}
CheckBox {
id: chkFixedZeros
text: "Fixed display of zeros"
checked: true
}
Row {
spacing: 15
Label {
text: "Displayed numbers after the decimal point (0 - 10):"
verticalAlignment: "AlignVCenter"
height: parent.height
}
SpinBox {
id: decimals_setter
from: 0
to: 10
value: 2
}
}
Row {
spacing: 15
Label {
text: "Accuracy (0 - 10):"
verticalAlignment: "AlignVCenter"
height: parent.height
}
SpinBox {
id: precision_setter
from: 0
to: 10
value: 2
}
}
Row {
spacing: 15
Label {
text: "Step (our control is used):"
verticalAlignment: "AlignVCenter"
height: parent.height
}
NumBox {
id: step_setter // step installer
height: 45
width: 200
value: 0.05
precision: precision_setter.value
minimumValue: 0.0
maximumValue: 100.0
step: Math.pow(10, -(precision))
editable: true
fixed: true
onFinishEdit: {
value = number;
}
}
}
CheckBox {
id: chkEnableSeqGrid
text: "Enable Snap to Step Grid " + superRealSpinBox.step.toString() + " (can be changed in the code)"
checked: false
}
CheckBox {
id: chkEditable
text: "Enable editing"
checked: true
}
CheckBox {
id: chk2click
text: "Double click editing (Optional)"
}
}
}
}