PDA

View Full Version : How to bind signal of item in QAbstractListModel to handler in delegate of ListView



ribtoks
29th November 2015, 15:41
I have a QAbstractListModel descendant class with list of instances of my arbitrary type MyItem inside. Also I have a ListView with model binding to that QAbstractListModel descendant.

All I want to do is to bind handler in delegate of ListView to the signal of my arbitrary type MyItem. Is there any way to do it?

UPD. I don't want to bind delegate to signal of a model so when I will have many items all of them will be triggered. I want to notify only one delegate with a signal.

anda_skoa
5th December 2015, 11:38
- Make a role that returns the object as a pointer.
- use a Connections element to create a signal handler for the signal on that object

Cheers,
_