views:

48

answers:

1

How can I detect which mouse button was clicked (right or left) in the slot for QtCore.SIGNAL('cellClicked(int,int)')?

A: 

You would probably pass the event to your cellClicked function. I'm assuming you emit your signal from a place that has access to a QMouseEvent.

Check out this thread.

Excerpt:

def mousePressEvent(self, event):
    if event.button() == QtCore.Qt.RightButton:
        event.accept()
        self.rightClickMenu(event)
    else:
        event.ignore()

Also, this mailing list thread looks like a more complete example.

tgray