From 527e5775a7b47f5d5b67a7b4af73f0fca16c3d70 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 20 Jul 2020 15:25:55 +0200 Subject: [PATCH] Also set clipping for string --- resources/qml/Settings/SettingTextField.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/qml/Settings/SettingTextField.qml b/resources/qml/Settings/SettingTextField.qml index d57bbaad8a..9fc3d0a554 100644 --- a/resources/qml/Settings/SettingTextField.qml +++ b/resources/qml/Settings/SettingTextField.qml @@ -153,7 +153,10 @@ SettingItem selectByMouse: true maximumLength: (definition.type == "str" || definition.type == "[int]") ? -1 : 10 - clip: definition.type == "[int]" // Only clip for the list + + // Since [int] & str don't have a max length, they need to be clipped (since clipping is expensive, this + // should be done as little as possible) + clip: definition.type == "str" || definition.type == "[int]" 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