diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml index 7c7f92be258..45de99f361c 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorEditor.qml @@ -15,18 +15,20 @@ SecondColumnLayout { property color color property bool supportGradient: false property variant backendValue + property variant value: { - if (colorEditor.backendValue === undefined - || colorEditor.backendValue.value === undefined) + if (!colorEditor.backendValue || !colorEditor.backendValue.value) return "white" // default color for Rectangle - if (colorEditor.isVector3D) + if (colorEditor.isVector3D) { return Qt.rgba(colorEditor.backendValue.value.x, colorEditor.backendValue.value.y, colorEditor.backendValue.value.z, 1) - else - return colorEditor.backendValue.value + } + + return colorEditor.backendValue.value } + property alias gradientPropertyName: popupLoader.gradientPropertyName property alias gradientThumbnail: gradientThumbnail diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ItemFilterComboBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ItemFilterComboBox.qml index 61bcc7e6296..aa7e25e73cb 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ItemFilterComboBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ItemFilterComboBox.qml @@ -21,7 +21,7 @@ HelperWidgets.ComboBox { } property string defaultItem: qsTr("[None]") - property string textValue: comboBox.backendValue.expression + property string textValue: comboBox.backendValue?.expression ?? "" property bool block: false property bool dirty: true diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml index 039f9e515ae..593a9b288d7 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml @@ -65,7 +65,7 @@ StudioControls.TextField { lineEdit.text = "" } else { if (lineEdit.writeValueManually) - lineEdit.text = convertColorToString(colorLogic.valueFromBackend) + lineEdit.text = convertColorToString?.(colorLogic.valueFromBackend) ?? "" else lineEdit.text = colorLogic.valueFromBackend }