Is there a bug in following behavior of QWebView / QWebPage?<br><br>PROGRAM 1:<br>----------------------------------<br><br>import sys<br>from PyQt4.QtGui import *<br>from PyQt4.QtCore import *<br>from PyQt4.QtWebKit import QWebView<br>
<br>if __name__ == &quot;__main__&quot;:<br>    app = QApplication(sys.argv)<br>    <br>    def on_load_finished(*args):<br>        print(&quot;on load finish called&quot;)<br>    <br>    webview = QWebView()<br>    webview.show()<br>
    QObject.connect(webview.page(), SIGNAL(&quot;loadFinished(bool)&quot;), on_load_finished )<br>    webview.page().mainFrame().load(QUrl(&#39;<a href="http://www.google.com/ncr&#39;">http://www.google.com/ncr&#39;</a>))<br>
    app.exec_()<br><br>--------------------------------------<br><br>In this case, the &quot;on_load_finished&quot; function is NOTcalled<br><br>However, if I cache the page, like following, <br><br>PROGRAM 2<br>----------------------------------------<br>
<br>import sys<br>from PyQt4.QtGui import *<br>from PyQt4.QtCore import *<br>from PyQt4.QtWebKit import QWebView<br><br>if __name__ == &quot;__main__&quot;:<br>    app = QApplication(sys.argv)<br>    <br>    def on_load_finished(*args):<br>
        print(&quot;on load finish called&quot;)<br>    <br>    webview = QWebView()<br>    webview.show()<br>    page = webview.page() #THIS LINE WAS ADDED<br>    QObject.connect(webview.page(), SIGNAL(&quot;loadFinished(bool)&quot;), on_load_finished )<br>
    webview.page().mainFrame().load(QUrl(&#39;<a href="http://www.google.com/ncr&#39;">http://www.google.com/ncr&#39;</a>))<br>    app.exec_()<br>------------------------------------------<br><br>Then the on_load_finished function DOES get called in this case<br>
<br>why the odd behavior? issit some sort of bug or issit just something I am not aware of? I tried looking up the documentation but there is nothing documenting this behavior.<br><br>Thanks for reading. <br><br><br><br><br>