[PyQt] Another wierd bug with QtWebKit

Karthik Tharavaad karthiktharavaad at gmail.com
Sat Jan 9 06:54:36 GMT 2010


in the same vein as the thread from yesterday. I get an error from this:

BEGIN PROGRAM-----------------

import sys
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from PyQt4.QtWebKit import QWebView
from PyQt4.QtNetwork import QNetworkAccessManager

if __name__ == "__main__":
    app = QApplication(sys.argv)
    view = QWebView()
    view.page().setNetworkAccessManager( QNetworkAccessManager() )
    view.page().mainFrame().load( QUrl("http://www.google.com") )
    view.show()
    sys.exit( app.exec_() )

----------------------------------------------

This CRASHES upon running, while THIS


BEGIN PROGRAM-----------------

import sys
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from PyQt4.QtWebKit import QWebView
from PyQt4.QtNetwork import QNetworkAccessManager

if __name__ == "__main__":
    app = QApplication(sys.argv)
    view = QWebView()
    manager = QNetworkAccessManager()  # ADDED LINE, CACHING manager
    view.page().setNetworkAccessManager(manager)
    view.page().mainFrame().load( QUrl("http://www.google.com") )
    view.show()
    sys.exit( app.exec_() )

----------------------------------------------

seems like when I create the QNetworkAccessManager(), it gets destroyed
right away after it gets added with setNetworkAccessManager(), however, this
should not be the case since QNetworkAccessManager is a QObject and should
be properly parented to the QWebPage when its added

lattest nightly builds of PyQt, SIP, Qt4.6, I've tried it on 2 different
computers runnning windows 7 and python 2.6
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100108/454f1ff9/attachment.html>


More information about the PyQt mailing list