[PyQt] QWebView::statusBarMessage receiving empty QStrings

Elver Loho elver.loho at gmail.com
Wed Feb 17 16:12:21 GMT 2010


I'm trying to catch statusbar changes in a QWebView and it seems to be
working, but every message is an empty QString.

Here's a minimal snippet of code to explain what I'm doing:

class MBrowser(QWebView):
    def __init__(self):
        super(QWebView, self).__init__()
        self.connect(self, SIGNAL("statusBarMessage(const QString&)"),
    def statusBarMessage(self, msg):
        self.logger.debug("Got status bar message: %s" % msg))

I'm invoking javascript from QWebView which then uses the following
function to write to the status bar:

function debug(msg) {
	window.status = "JS: " + msg;

It seems that every time the debug() function is called from
javascript, statusBarMessage() is successfully invoked in my code, but
the msg is always an empty QString. Which is really weird. Especially
considering that I clearly remember this code working before.

I'm gonna keep fiddling with it, but I figured that I'd post a
question here in case anyone else has ever come across anything like
this before and could save me a few hours :)


elver.loho at gmail.com
+372 5661 6933
skype: elver.loho
Sent from Tartu, Estonia

More information about the PyQt mailing list