From f112076227c1c58236a2b0774df2c37dec130578 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Thu, 7 Aug 2014 15:46:10 +0200 Subject: [PATCH] QmlDesigner.ComboBox: Minor fix If we cannot read the index we set the index to 0. Change-Id: Id990ca1640f9314931af9249c798c8b51ea5c0bb Reviewed-by: Tim Jenssen --- .../propertyEditorQmlSources/HelperWidgets/ComboBox.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ComboBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ComboBox.qml index c80fa15b2f2..24ac31bf1e0 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ComboBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/ComboBox.qml @@ -66,8 +66,11 @@ Controls.ComboBox { var index = comboBox.find(enumString) + if (index < 0) + index = 0 + if (index !== comboBox.currentIndex) - comboBox.currentIndex = comboBox.find(enumString) + comboBox.currentIndex = index } else { if (comboBox.currentIndex !== backendValue.value)