I have this script with which I would like to do some more stuff when it is ready:
from PyQt4 import QtCore, QtGui, QtWebKit
class WebViewCreator:
def __init__(self):
self.view = QtWebKit.QWebView()
self.view.setPage(QtWebKit.QWebPage())
self.view.connect(self.view, QtCore.SIGNAL('loadFinished(bool)'), self.load_finished)
path = self.app.resources_uri() + "/index.html"
self.view.load(QtCore.QUrl(path))
def load_finished(self, ok):
print ok
def onDone(ok):
print ok
The problem I have is that if I connect a function to the loadFinished(bool) signal then the function gets executed, but if I connect a method of the object like self.load_finished then this method is not called and I can't understand why :-/
The same happens with:
self.view.loadFinished.connect(onDone)
versus:
self.view.loadFinished.connect(self.load_finished)