[PyQt] Segmentation fault in keyPressEvent

Phil Thompson phil at riverbankcomputing.com
Thu Sep 17 21:52:32 BST 2009


On Thu, 17 Sep 2009 21:45:41 +0200, Mads Ipsen <mpi at comxnet.dk> wrote:
> The following script triggers a segmentation fault:
> 
> import sys
> from PyQt4 import QtGui
> 
> if __name__ == "__main__":
>     app = QtGui.QApplication(sys.argv)
> 
>     widget = QtGui.QWidget()
>     widget.show()
>     widget.keyPressEvent(None)
> 
>     sys.exit(app.exec_())
> 
> I believe it should generate an error.

Possibly but at the moment PyQt doesn't know if Qt is going to dereference
a pointer.

Phil


More information about the PyQt mailing list