I made it work ... however I am not sure it's a pretty solution.
1/ On the TreeView, I override QAbstractItemView::mouseReleaseEvent() so I can retrieve the list of selected rows. I give this list to the delegate then I call QAbstractItemView::mouseReleaseEvent() on the parent class.
2/ In the delegate class, I override QAbstractItemDelegate::editorEvent(). For the QEvent::MouseButtonRelease event, I check if the click hits an icon and then call a method itemClicked() on my proxy model with the given index and the list of selected rows I previously stored.
3/ In the method itemClicked() of the proxy model, I check if the index is part of the selection and update the value of the given index and all selected items.
I ran a few tests and it looks like it works but I need more tests to be sure.
I was also thinking about giving the list of selected rows directly to the proxy model so my delegate would only check the position of the mouse and then let the proxy model work on all selected items.
I still have a question if you don't mind ... When hitting an icons, I would like to keep the selection. For example, I have 3 items (1, 2, 3), I select 1 & 2 and I hit an icon on the 3rd item, I would like to keep 1 & 2 as the selected items.
I tried to do it in the QAbstractItemDelegate::editorEvent() and it works when I hit an icon for a non-selected item. But when I hit an icon for an item which is a part of the selection, this particular item is the only one selected afterwards.
Regards,
Lionel
Bookmarks