I've a list of QListWidgetItem in QListWidget(Horizontal scroll bar is there as num of items is huge). Each QListWidgetItem contains a QPixmap as a data(scaled down to some random value). My requirement is when a QPixmap is clicked that should be highlighted(rounded rect of brushwidth 10). I'm delegating QListWidget to a QItemDelegate for painting. I've couple of questions here.

1.How to Paint the rounded rect of QPixmap when the corresponding QListWidgetItem is selected? I've one approach for this. In the Delegate paint event, get the Qpixmap of the listitem and paint the border(rounded rect) of Qpixmap painter and paint that Qpixmap to that List item. For this approach we don't know the exact coordinates to paint the Qpixmap as there are many items.

2.The above mentioned paint event should occur when QPixmap is clicked(not in the other parts of QListWidgetItem). As QPixmaps are of different sizes, top and bottom part of QPixmaps in QListWidgetItem will be blank and clicking there also will trigger the ItemDelegate. How to get rid of this selection?