[PyQt] QWebPage error

Phil Thompson phil at riverbankcomputing.com
Wed Jan 6 09:22:49 GMT 2010


On Tue, 5 Jan 2010 15:57:10 -0800, Karthik Tharavaad
<karthiktharavaad at gmail.com> wrote:
> attempting to run this simple program, after I close the button window,
it
> crashes my python.exe
> 
> It seems like whenver I have an undeleted instance of QWebPage in my
> program, it crashes upon exit.
> 
> from PyQt4.QtWebKit import QWebPage
> from PyQt4.QtGui import *
> import sys
> 
> if __name__ == "__main__":
>     app = QApplication(sys.argv)
>     btn = QPushButton("exit")
>     btn.show()
>     page = QWebPage()
>     app.exec_()
> 
> using latest version of Qt and lattest nightly builds of PyQt and SIP on
> windows 7 w. python 2.6

This is probably a Qt bug triggered by the QWebPage being destroyed after
the QApplication. The workaround in your example is to explicitly del the
page when exec_() returns.

Phil


More information about the PyQt mailing list