From 8f9fa82880664be11fea7945042087be49bd708f Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Fri, 16 Aug 2019 10:55:14 +0200 Subject: [PATCH] QmlDesigner: Fix HelperWidgets ComboBox Task-number: QDS-926 Change-Id: I77eafbf8c66b8a384dc8786726c74c89acad58ad Reviewed-by: Thomas Hartmann --- .../imports/HelperWidgets/ComboBox.qml | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComboBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComboBox.qml index 62a285a52ba..74414cb592b 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComboBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComboBox.qml @@ -62,9 +62,7 @@ StudioControls.ComboBox { ColorLogic { id: colorLogic backendValue: comboBox.backendValue - onValueFromBackendChanged: { - invalidate(); - } + onValueFromBackendChanged: invalidate() function invalidate() { @@ -74,9 +72,9 @@ StudioControls.ComboBox { block = true if (manualMapping) { - valueFromBackendChanged(); + comboBox.valueFromBackendChanged() } else if (!comboBox.useInteger) { - var enumString = comboBox.backendValue.enumeration; + var enumString = comboBox.backendValue.enumeration if (enumString === "") enumString = comboBox.backendValue.value @@ -100,24 +98,23 @@ StudioControls.ComboBox { onActivated: { if (!__isCompleted) - return; + return if (backendValue === undefined) - return; + return if (manualMapping) - return; + return if (!comboBox.useInteger) { - backendValue.setEnumeration(comboBox.scope, comboBox.currentText); + backendValue.setEnumeration(comboBox.scope, comboBox.currentText) } else { - backendValue.value = comboBox.currentIndex; + backendValue.value = comboBox.currentIndex } } Component.onCompleted: { colorLogic.invalidate() - __isCompleted = true; + __isCompleted = true } - }