Why don't work linkClicked, and works linkHovered PyQt4?
<p>Here is some code. I created modal window, set easy html, and then I want to connect some method on click link. Signal "linkClicked" dont works , but link are loaded. And signal <strong>linkHovered</strong> works.  Where is mistake? And how to include some method to "linkClicked"?</p>

<pre><code># -*- coding: utf-8 -*-
import sys

from PyQt4 import QtCore
from PyQt4 import QtGui
from PyQt4 import QtWebKit

class MainWindow(QtGui.QMainWindow):
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        self.resize(1000, 500)
        self.menu_bar = self.menuBar()
        self.menuEngine()
    def menuEngine(self):
        self.podmenu2 = self.menu_bar.addMenu("Help")
        self.about = QtGui.QAction("About", self )
        self.about.setIconVisibleInMenu(True)
        self.podmenu2.addAction(self.about)
        self.about.triggered.connect(self.aboutView)
    def aboutView(self):
        def clicks(url):
            print("DDD")
            print(url)
        mod_window = QtGui.QWidget(self, QtCore.Qt.Window)
        mod_window.setWindowTitle("About")
        mod_window.resize(500, 332)
        horLayout = QtGui.QHBoxLayout(mod_window)
        localHtmls = QtWebKit.QWebView()

        localHtmls.setHtml("""
            &lt;html&gt;
            &lt;head&gt;
                &lt;meta charset="utf-8"/&gt;
            &lt;/head&gt;
            &lt;body&gt;
                &lt;div&gt;
                    &lt;br/&gt;
                    Home page &lt;a href="https://google.com"&gt;LINK&lt;/a&gt;
                &lt;/div&gt;
            &lt;/body&gt;
            &lt;/html&gt;
        """)
        horLayout.addWidget(localHtmls)

        localHtmls.linkClicked.connect(clicks)
        #localHtmls.page().linkHovered.connect(clicks)
        mod_window.show()

if __name__ == "__main__":
     app = QtGui.QApplication(sys.argv)
     windows = MainWindow()
     windows.show()
     sys.exit(app.exec_())
</code></pre>

<p>From the documentation for <a href="http://doc.qt.io/qt-4.8/qwebview.html#linkClicked" rel="nofollow">linkClicked</a>:</p>

<blockquote>
  <p>This signal is emitted whenever the user clicks on a link and the
  page's linkDelegationPolicy property is set to delegate the link
  handling for the specified url.</p>
</blockquote>

<p>So try:</p>

<pre><code>localHtmls.page().setLinkDelegationPolicy(QtWebKit.QWebPage.DelegateAllLinks)
</code></pre>

<p>But note that this completely bypasses the normal link-click handling, so you will have to implement that yourself (e.g. call <code>load(url)</code>).</p>

python pyqt4 qtwebkit qwebview