[Qt-interest] Mouse events inside item view delegates

Neville Dastur qt at dastur.me.uk
Sun Aug 22 00:16:30 CEST 2010


Hi

I don't know if someone can help me. I have a QTreeView and for one of 
the columns I set a custom delegate. This delegate paints a number of 
icons in a row, within that column, representing buttons.

Now I want to be able to detect a mouse click on my custom delegate and 
determine the position within the item so that I know which item has 
been "clicked"

For the life of me a and plenty of searching I can't find out how to do 
this.

 From within the on_treeView_clicked(QModelIndex *i) slot I can find a 
way of getting mouse coordinates relative to the item and the 
MouseRelease event doesn't seem to get called at all.

Any pointers will be gratefully received.

Thanks

Neville



More information about the Qt-interest-old mailing list