From e593322b432d113d1b6e52b7adba3773119d7875 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Mon, 4 Apr 2022 10:38:09 +0200 Subject: [PATCH] When getting active focus textinput value was being cleared. However if text was inputted then this would stay between active focus states. This commit forces the value to be assigned the value in the textInput when active focus is given. CURA-8640 --- resources/qml/Settings/SettingTextField.qml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/resources/qml/Settings/SettingTextField.qml b/resources/qml/Settings/SettingTextField.qml index 01f5aea381..27952f3c13 100644 --- a/resources/qml/Settings/SettingTextField.qml +++ b/resources/qml/Settings/SettingTextField.qml @@ -162,6 +162,13 @@ SettingItem property: "text" value: { + if (input.activeFocus) + { + // In QT6 using "when: !activeFocus" causes the value to be null when activeFocus becomes True + // Since we want the value to stay the same when giving focus to the TextInput this is being used + // in place of "when: !activeFocus" + return input.text + } // Stacklevels // 0: user -> unsaved change // 1: quality changes -> saved change @@ -181,7 +188,6 @@ SettingItem return propertyProvider.properties.value } } - when: !input.activeFocus } MouseArea