Fixing bug with TextInput allowing unallowed characters.

This commit is contained in:
Ad5001 2022-02-08 14:33:08 +01:00
parent ca51f979b8
commit f229dc014c
Signed by: Ad5001
GPG key ID: EF45F9C6AFE20160

View file

@ -112,6 +112,9 @@ Item {
verticalAlignment: TextInput.AlignVCenter
horizontalAlignment: control.label == "" ? TextInput.AlignLeft : TextInput.AlignHCenter
color: sysPalette.windowText
validator: RegExpValidator {
regExp: control.isInt ? /-?[0-9]+/ : control.isDouble ? /-?[0-9]+(\.[0-9]+)?/ : /.+/
}
focus: true
text: control.defValue
selectByMouse: true