QmlDesigner: Remove some helper widgets warnings on QDS shut down

Change-Id: I843124f2f0644f846faa7a6e6d8e8a9bb6792764
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
Mahmoud Badri
2023-03-16 17:33:22 +02:00
parent c55ca15442
commit 020d38db1a
3 changed files with 9 additions and 7 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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
}