From 03fe03ed65eb39ed82448376f3984be3c847dc46 Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Mon, 16 Jan 2017 16:05:21 +0000 Subject: [PATCH] Modify the constraints of the SettingTextField when the setting type is "str". When the setting type is "str" it now allows the setting contents to be up to 20 characters long with no constraint on what those characters are. --- resources/qml/Settings/SettingTextField.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Settings/SettingTextField.qml b/resources/qml/Settings/SettingTextField.qml index da24f0f521..af899bec12 100644 --- a/resources/qml/Settings/SettingTextField.qml +++ b/resources/qml/Settings/SettingTextField.qml @@ -98,9 +98,9 @@ SettingItem selectByMouse: true; - maximumLength: 10; + maximumLength: (definition.type == "str") ? 20 : 10; - validator: RegExpValidator { regExp: (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 == "str") ? /^.{0,20}$/ : (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 {