Skip to content

Commit

Permalink
Merge f8332f8 into b3ed6bd
Browse files Browse the repository at this point in the history
  • Loading branch information
Voldivh authored Oct 3, 2023
2 parents b3ed6bd + f8332f8 commit dd9080e
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions include/gz/gui/qml/GzSpinBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,32 @@
*
*/
import QtQuick 2.9
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls 2.15

SpinBox {
style: SpinBoxStyle{
Control {
id: spinBoxItem
property real minimumValue : 0
property real maximumValue : 100
property real stepSize : 0
property int decimals : 0
property real value : 0
signal editingFinished

TextField {
id: numberField
placeholderText: spinBoxItem.value
horizontalAlignment: TextInput.AlignHCenter
activeFocusOnPress: spinBoxItem.activeFocusOnPress
enabled: false // The TextField is disabled for the moment due to a not desired behavior.
validator: DoubleValidator{bottom: spinBoxItem.minimumValue;
top: spinBoxItem.maximumValue;
decimals: spinBoxItem.decimals;
notation: DoubleValidator.StandardNotation;
}
onEditingFinished: {
spinBoxItem.value = parseFloat(text)
spinBoxItem.editingFinished()
}
background: Rectangle {
implicitWidth: 70
implicitHeight: 40
Expand Down

0 comments on commit dd9080e

Please sign in to comment.