[PySide] detecting left/right click in QListView

[QUOTE=rgkovach123;27518]you are on the right track, but instead of connecting to the mouseReleaseEvent, I would just subclass the QListView and re-implement the Mouse event.

class MyListView(QtGui.QListView):
   

    def __init__(self):
        super(MyListView, self).__init__()  

  
    def mousePressEvent(self, event):     
        if event.type() == QtCore.QEvent.MouseButtonPress:
            if event.button() == QtCore.Qt.RightButton:
                return
            else:
                super(MyListView, self).mousePressEvent(event)

[/QUOTE]

I completely understand what you are telling me and I have left/right click filtering working the way I want but the main problem is that I want to know weather I clicked on the item in the list or I just clicked on the list but not on the item. How can I know if the click on the QListView occured over an item in the list or not? That is my only problem, maybe I’m not explaining myself that well.