Hi,

I need a clickable QML element that is model-based and gives back a reference to its model entry (a complex Object that lives in a QAbstractListModel) on click.

When the Element is generated with a repeater I could use this code (works!):
Qt Code:
  1. Repeater {
  2. id: buttonRepeater
  3. model: loaderModel
  4. delegate: CustomButton {
  5. id: customButtonDelegate
  6. objectName: model.name
  7. buttonColor: model.buttonColor
  8. onClicked: { loaderModel.buttonClicked(loaderModel.get(index)) }
  9. }
  10. }
To copy to clipboard, switch view to plain text mode 
However, within a TableViewColumn this does not work, the latter apparently lacks an "index" (doesn't work!):
Qt Code:
  1. TableView {
  2. id: dynamicTableViewBasis
  3. model: sceneLoader.loaderModel
  4.  
  5. Component {
  6. id: columnComponent
  7. TableViewColumn {
  8. width: 70
  9. delegate: CustomButton {
  10. id: buttonDelegate
  11. objectName: model.nameTop
  12. buttonColor: model.buttonColor
  13. onClicked: {sceneLoader.loaderModel.buttonClicked(sceneLoader.loaderModel.get(index)) }
To copy to clipboard, switch view to plain text mode 

I recieve an error message that says
ReferenceError: index is not defined
How can I achieve that kind of call (flawlessly working inside a repeater) in a QML TableView?

[Please note that the table's columns are being generated dynamically, thus the "Component" stuff.]