From 0c212d01b9053007a7218379c31604384f11d9f9 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 16 Dec 2016 15:28:38 +0100 Subject: [PATCH] Tighten regex for floats You're no longer allowed to type multiple radices, for instance. Contributes to issue CURA-3157. --- resources/qml/Settings/SettingTextField.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Settings/SettingTextField.qml b/resources/qml/Settings/SettingTextField.qml index d89f540aa3..eada681627 100644 --- a/resources/qml/Settings/SettingTextField.qml +++ b/resources/qml/Settings/SettingTextField.qml @@ -100,7 +100,7 @@ SettingItem maximumLength: 10; - validator: RegExpValidator { regExp: (definition.type == "int") ? /^-?[0-9]{0,10}/ : /^-?[0-9.,]{0,10}/ } // definition.type property from parent loader used to disallow fractional number entry + validator: RegExpValidator { regExp: (definition.type == "int") ? /^-?[0-9]{0,10}$/ : /^-?[0-9]?[.,]?[0-9]{0,10}$/ } // definition.type property from parent loader used to disallow fractional number entry Binding {