[PyQt] Problem with QWebView

mir amicitas amicitas at gmail.com
Sun Apr 5 21:38:37 BST 2009


I am having an issue with QWebView.  If I use a QWebView, then after I
close my application I get the following error:

QWaitCondition: Destroyed while threads are still waiting


This error only comes up if I actually load a web page (with either
load() or setUrl()).


What am I doing wrong here?  Do I need to explicitly call something to
destroy the QWebView widget?

Novi

# Main application class.
#####################
    def showHelpDialog(self):

        help = HelpWindow(self)
        help.show()

class HelpWindow(QtGui.QMainWindow):
    def __init__(self, parent):
        QtGui.QMainWindow.__init__(self, parent)

        self.setWindowTitle('TrackChanges Help')

        help_browser = HelpWebBrowser(self)

        self.setCentralWidget(help_browser)

        self.resize(700,500)

class HelpWebBrowser(QtGui.QWidget):
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)

        # We load this on the fly to reduce memory footprint.
        from PyQt4 import QtWebKit

        self.browser_main = QtWebKit.QWebView(self)

        url_main = QtCore.QUrl('http://qtsoftware.com')
        self.browser_main.setUrl(url_main)

        # Set the layout
        main_layout = QtGui.QHBoxLayout()
        main_layout.addWidget(self.browser_main)

        self.setLayout(main_layout)


More information about the PyQt mailing list