I have just started learning QML and was trying to implement a simple table via a ListView (using this SO article as a guide).
I wanted to make one of the columns editable so I used TextField
in place of Label
for that column. Where I came unstuck was finding how to write the updated value back into the model. I found the setProperty
method on the model but it was not at all clear how to access the index of the delegate's 'current item' to provide as the first argument of the method call.
After trying and failing to use currentIndex
, eventually I discovered that I could in fact use index
but I don't understand how I should have known this and where it is documented. I ask this question because I suspect there are some basic concepts I am missing that should have made this obvious.