On Fri, 8 Jan 2010 22:54:36 -0800, Karthik Tharavaad <[email protected]> wrote: > 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
No it shouldn't. If that were the case how would you use a manager with more than one page? Phil _______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
