3D view now shows lights and added double spinbox

This commit is contained in:
2023-02-22 01:25:32 +01:00
parent a0b77ead41
commit 58c65c73f2
9 changed files with 113 additions and 526 deletions

39
DoubleSpinBox.qml Normal file
View File

@@ -0,0 +1,39 @@
import QtQuick
import QtQuick.Controls
SpinBox {
id: spinbox
property int decimals: 2
property real factor: 100
property real realFrom: from / factor
property real realTo: to / factor
property real realValue: value / factor
from: realFrom * factor
to: realTo * factor
value: realValue * factor
stepSize: factor
signal realValueModified
onValueModified: {
realValue = Qt.binding(function(){ return value / factor; });
realValueModified();
}
validator: DoubleValidator {
bottom: Math.min(spinbox.from, spinbox.to)
top: Math.max(spinbox.from, spinbox.to)
}
textFromValue: function(value, locale) {
return Number(value / 100).toLocaleString(locale, 'f', spinbox.decimals)
}
valueFromText: function(text, locale) {
return Number.fromLocaleString(locale, text) * 100
}
}