[GraphEditor] Do not assign undefined to edge-related properties

This fixes the following QML warnings that may appear when performing
lots of operations on edges:
`Unable to assign [undefined] to QString/bool`

These warnings do not seem to have any functional impact on the connection
processes.
This commit is contained in:
Candice Bentéjac 2024-09-03 16:29:06 +02:00
parent 321ffec85f
commit 7686c48e89
2 changed files with 11 additions and 11 deletions

View file

@ -130,8 +130,8 @@ RowLayout {
readonly property string connectorType: "input"
readonly property alias attribute: root.attribute
readonly property alias nodeItem: root.nodeItem
readonly property bool isOutput: attribute.isOutput
readonly property string baseType: attribute.baseType
readonly property bool isOutput: Boolean(attribute.isOutput)
readonly property string baseType: attribute.baseType !== undefined ? attribute.baseType : ""
readonly property alias isList: root.isList
property bool dragAccepted: false
anchors.verticalCenter: parent.verticalCenter
@ -192,7 +192,7 @@ RowLayout {
enabled: !root.readOnly
property bool hovered: (inputConnectMA.containsMouse || inputConnectMA.drag.active || inputDropArea.containsDrag || outputConnectMA.containsMouse || outputConnectMA.drag.active || outputDropArea.containsDrag)
text: attribute ? attribute.label : ""
text: (attribute && attribute.label) !== undefined ? attribute.label : ""
elide: hovered ? Text.ElideNone : Text.ElideMiddle
width: hovered ? contentWidth : parent.width
font.pointSize: 7
@ -279,9 +279,9 @@ RowLayout {
readonly property string connectorType: "output"
readonly property alias attribute: root.attribute
readonly property alias nodeItem: root.nodeItem
readonly property bool isOutput: attribute.isOutput
readonly property bool isOutput: Boolean(attribute.isOutput)
readonly property alias isList: root.isList
readonly property string baseType: attribute.baseType
readonly property string baseType: attribute.baseType !== undefined ? attribute.baseType : ""
property bool dropAccepted: false
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter