[PyQt] Disabling a key event

Gustavo A. Díaz gustavo.diaz at gmail.com
Thu Oct 18 03:22:32 BST 2007


Hi!

What i want to do this time, is to disable a key event in my app. For
example i want to avoid closing the app by pressing ALT + F4:

def keyPressEvent(self, event):
        if event.key() == QtCore.Qt.Key_F4 and (event.modifiers() &
        QtCore.Qt.AltModifier):
            # DO Nothing. How?

So, which action or code i should implement in place of "# DO Nothing. How?"
?

Thanks.

Cheers.

-- 
Gustavo A. Díaz
GDNet Projects
www.gdnet.com.ar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20071018/31a54562/attachment.html


More information about the PyQt mailing list