Add position field to device settings

This commit is contained in:
2023-02-15 20:17:58 +01:00
parent 579eba2b1b
commit e30c5293ed
6 changed files with 66 additions and 6 deletions

50
Vector3DField.qml Normal file
View File

@@ -0,0 +1,50 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls.Material
RowLayout {
property vector3d value
onValueChanged: {
xBox.value = value.x
yBox.value = value.y
zBox.value = value.z
}
signal valueModified
function updateValue() {
const newValue = Qt.vector3d(xBox.value, yBox.value, zBox.value);
console.log(newValue);
if (newValue === value)
return;
value = newValue;
valueModified();
}
Label {
text: qsTr('x:')
}
SpinBox {
id: xBox
onValueModified: updateValue()
}
Label {
text: qsTr('y:')
}
SpinBox {
id: yBox
onValueModified: updateValue()
}
Label {
text: qsTr('z:')
}
SpinBox {
id: zBox
onValueModified: updateValue()
}
}