Browse Source

fix: more lenient int-list validator parsing (CURA-3275)
allow for empty integers
allow the brackets to be omitted

Tim Kuipers 8 years ago
parent
commit
38a9df9d76
1 changed files with 1 additions and 1 deletions
  1. 1 1
      resources/qml/Settings/SettingTextField.qml

+ 1 - 1
resources/qml/Settings/SettingTextField.qml

@@ -100,7 +100,7 @@ SettingItem
 
             maximumLength: (definition.type == "[int]") ? 20 : 10;
 
-            validator: RegExpValidator { regExp: (definition.type == "[int]") ? /^\[(\s*-?[0-9]+\s*,)*(\s*-?[0-9]+)\s*\]$/ : (definition.type == "int") ? /^-?[0-9]{0,10}$/ : /^-?[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}$/ : /^-?[0-9]{0,9}[.,]?[0-9]{0,10}$/ } // definition.type property from parent loader used to disallow fractional number entry
 
             Binding
             {