From 7686c48e898cbe16593b4af30ac1ba3a6f1de88f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Tue, 3 Sep 2024 16:29:06 +0200 Subject: [PATCH] [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. --- meshroom/ui/qml/GraphEditor/AttributePin.qml | 10 +++++----- meshroom/ui/qml/GraphEditor/Node.qml | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/AttributePin.qml b/meshroom/ui/qml/GraphEditor/AttributePin.qml index 630daaf0..2d391ac8 100755 --- a/meshroom/ui/qml/GraphEditor/AttributePin.qml +++ b/meshroom/ui/qml/GraphEditor/AttributePin.qml @@ -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 diff --git a/meshroom/ui/qml/GraphEditor/Node.qml b/meshroom/ui/qml/GraphEditor/Node.qml index 47ecdfaf..efb041d0 100755 --- a/meshroom/ui/qml/GraphEditor/Node.qml +++ b/meshroom/ui/qml/GraphEditor/Node.qml @@ -407,8 +407,8 @@ Item { delegate: Loader { id: outputLoader - active: object.isOutput && object.desc.visible - visible: object.enabled || object.hasOutputConnections + active: Boolean(object.isOutput && object.desc.visible) + visible: Boolean(object.enabled || object.hasOutputConnections) anchors.right: parent.right width: outputs.width @@ -443,7 +443,7 @@ Item { delegate: Loader { id: inputLoader active: !object.isOutput && isFileAttributeBaseType(object) - visible: object.enabled + visible: Boolean(object.enabled) width: inputs.width sourceComponent: AttributePin { @@ -503,8 +503,8 @@ Item { delegate: Loader { id: paramLoader active: !object.isOutput && !isFileAttributeBaseType(object) - visible: object.enabled || object.isLink || object.hasOutputConnections - property bool isFullyActive: (m.displayParams || object.isLink || object.hasOutputConnections) + visible: Boolean(object.enabled || object.isLink || object.hasOutputConnections) + property bool isFullyActive: Boolean(m.displayParams || object.isLink || object.hasOutputConnections) width: parent.width sourceComponent: AttributePin { @@ -517,7 +517,7 @@ Item { Behavior on height { PropertyAnimation {easing.type: Easing.Linear} } visible: (height == childrenRect.height) attribute: object - readOnly: root.readOnly || object.isReadOnly + readOnly: Boolean(root.readOnly || object.isReadOnly) Component.onCompleted: attributePinCreated(attribute, inParamsPin) Component.onDestruction: attributePinDeleted(attribute, inParamsPin) onPressed: root.pressed(mouse)