From 53b481ff5d681375e85b7c0bfaa36598c34b48f3 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Sat, 29 Sep 2018 08:16:11 +0200 Subject: [PATCH] Reduce the maximum precision of floats in SettingTextField inputs No settings in Cura require more than 3 digits of precision. Many settings are in mm, and CuraEngine does its calculations in while microns. Having more precision in the frontend than in the backend apparently thoroughly confuses some people. Fixes #4368 --- 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 15782829d3..9ec9338316 100644 --- a/resources/qml/Settings/SettingTextField.qml +++ b/resources/qml/Settings/SettingTextField.qml @@ -152,7 +152,7 @@ SettingItem maximumLength: (definition.type == "str" || definition.type == "[int]") ? -1 : 10; clip: true; //Hide any text that exceeds the width of the text box. - validator: RegExpValidator { regExp: (definition.type == "[int]") ? /^\[?(\s*-?[0-9]{0,9}\s*,)*(\s*-?[0-9]{0,9})\s*\]?$/ : (definition.type == "int") ? /^-?[0-9]{0,10}$/ : (definition.type == "float") ? /^-?[0-9]{0,9}[.,]?[0-9]{0,10}$/ : /^.*$/ } // definition.type property from parent loader used to disallow fractional number entry + validator: RegExpValidator { regExp: (definition.type == "[int]") ? /^\[?(\s*-?[0-9]{0,9}\s*,)*(\s*-?[0-9]{0,9})\s*\]?$/ : (definition.type == "int") ? /^-?[0-9]{0,10}$/ : (definition.type == "float") ? /^-?[0-9]{0,9}[.,]?[0-9]{0,3}$/ : /^.*$/ } // definition.type property from parent loader used to disallow fractional number entry Binding {