I'm using PySide with Qt 4.7 and having a problem with keyReleaseEvent in my QMainWindow. Here is the code:
def keyReleaseEvent(self, event):
if event.key() == QtCore.Qt.Key_Alt:
print 'Alt Key Released'
if self.pointerTypeGroup.checkedId() != self.scene.HandDrag:
print "Disabling Drag"
self.pointerGroupClicked(self.pointerTypeGroup.checkedId())
#event.accept()
#super(MainWindow, self).keyPressEvent(event)
This only works on every other key release. The first is ignored, the second works, the third fails, the fourth works, and so on. It doesn't matter whether I implement keyPressEvent, whether I put in an event.accept() or whether I call the base implementation afterwards. Those have no effect on the behaviour.
I'm using this to make a map in a QGraphicsView draggable. If I implement keyPressEvent and drag the map, as long as I manipulate the map between each key press, keyReleaseEvent is never called.
Any ideas what's going on?