PDA

View Full Version : Signal from inside a delegate



hailflex
13th December 2009, 04:33
Hello,

im emitting a signal from inside a delegate that overrides the paint function, but from outiside i cant manage to connect the signal because its not recognized...

http://pastie.org/741017

This is a part of the code, from different files... im using setItemDelegate in another delegate (VListView) so I dont know exactly how it works... do i need to create a VListView::setItemDelegate to make it work? What am i missing?

franz
13th December 2009, 10:40
Aren't you confusing QAbstractItemViews with QAbstractItemDelegates here? An item view does not propagate a signal from an item delegate and vice versa unless explicitly coded to do so.

wysota
13th December 2009, 10:47
Emitting a signal from the delegate's paint() routine is a bad idea. Even if you do connect the signal, you will have it emitted in random moments of time and slowing down your application. I suggest you connected to one of the QItemSelectionModel signals instead. And next time please attach code to your post instead of using 3rd party sites.