Let\'s say I have a ListView
of clickable delegate components (or GridView
or Repeater
). These delegate components need to emit a signal a
You could connect both signals in the Component.onCompleted
handler.
Using your code it would be something like this:
ListView {
id: myListView
width: 100
height: 600
model: myModel
delegate: TheDelegate {
name: model.name
Component.onCompleted: {
trigger.connect(root.componentTriggered)
}
}
}
Instead of calling the signal componentTriggered
you could also implement a function, but it depends on your requirements. The signal is OK in any case.