[qt6][GraphEditor] Fix connections to ListAttribute pins

The callbacks of `childrenRepeater` (which was used to "fill"
`ListAttributes` with children) were not correctly set. Their prototypes
were missing the `index` argument, meaning that instead of being
provided with the child attribute that was added or deleted,
they were provided with its index in the model.

The added children attributes were also instatiated as empty attribute
pins that were still visible, thus increasing indirectly the spacing of
the initial pin.
This commit is contained in:
Candice Bentéjac 2024-10-10 19:31:56 +02:00
parent 52444ef0ad
commit 039504782f

View file

@ -58,10 +58,11 @@ RowLayout {
Repeater {
id: childrenRepeater
model: isList && !attribute.isLink ? attribute.value : 0
onItemAdded: function(item) { childPinCreated(item.childAttribute, item) }
onItemRemoved: function(item) { childPinDeleted(item.childAttribute, item) }
onItemAdded: function(index, item) { childPinCreated(item.childAttribute, root) }
onItemRemoved: function(index, item) { childPinDeleted(item.childAttribute, root) }
delegate: Item {
property var childAttribute: object
visible: false
}
}