Skip to content

Commit

Permalink
Changes SpinBox for a TextField
Browse files Browse the repository at this point in the history
Signed-off-by: Voldivh <[email protected]>
  • Loading branch information
Voldivh committed Sep 20, 2023
1 parent c01d327 commit 37a3488
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions include/gz/gui/qml/GzSpinBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,31 @@ import QtQuick 2.9
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4

SpinBox {
style: SpinBoxStyle{
background: Rectangle {
implicitWidth: 70
implicitHeight: 40
border.color: "gray"
Item {
property double minimumValue : 0
property double maximumValue : 100
property double stepSize : 0
property double decimals : 0
property real value : 0
signal onEditingFinished()

TextField {
id: numberField
placeholderText: "0.0"
validator: DoubleValidator{bottom: minimumValue;
top: maximumValue;
decimals: decimals;
notation: DoubleValidator.StandardNotation;
}
onEditingFinished: {
parent.value = parseFloat(text)
}
style: TextFieldStyle{
background: Rectangle {
implicitWidth: 70
implicitHeight: 40
border.color: "gray"
}
}
}
}

0 comments on commit 37a3488

Please sign in to comment.