Accessing Items within delegates with duplicate ids #98
davidljung
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It seems that, when using Items like ListView and TableView, the delegate Item is instantiated multiple times for each row or cell. Hence, if you have Items with ids or objectNames in your delegate, they won't be uniquely named.
In fact, using the item path syntax of Spix, it doesn't see into the delegates from the parent view (e.g. ListView) - perhaps due to the way they're dynamically created and where they're attached.
However, you can access Items by id at the level of the delegate and down directly - but those will still be duplicated for each row/cell, so you'll typically just access the first one it finds - such as the top row or first cell.
Does anyone have a suggestion for how Spix could be improved to allow accessing Items within a delegate-based model view, like ListView or TableView? or, alternatively, a workaround for use as-is?
(I tried making an Item within a delegate have an objectName that includes the delegate index, but that doesn't appear to work. Update: the examples includes one in which a ListView has dynamic objectName that includes the index, so it appears that should work)
Beta Was this translation helpful? Give feedback.
All reactions