Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4082924
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:14:52+00:00 2026-05-20T18:14:52+00:00

import sys from PyQt4.QtGui import * from PyQt4.QtCore import * from PyQt4.QtWebKit import QWebView

  • 0
import sys

from PyQt4.QtGui import *
from PyQt4.QtCore import *
from PyQt4.QtWebKit import QWebView

app = QApplication(sys.argv)
web_view = QWebView()
def url_changed(url):  print 'url changed: ', url
def link_clicked(url):  print 'link clicked: ', url
def load_started():  print 'load started'
def load_finished(ok):  print 'load finished, ok: ', ok
web_view.connect(web_view, SIGNAL("urlChanged(const QUrl&)"), url_changed)
web_view.connect(web_view, SIGNAL("linkClicked(const QUrl&)"), link_clicked)
web_view.connect(web_view, SIGNAL('loadStarted()'), load_started)
web_view.connect(web_view, SIGNAL('loadFinished(bool)'), load_finished)
web_view.load(QUrl('http://google.com'))
web_view.show()
sys.exit(app.exec_())

The linkClicked signal isn’t working. The other signals work. Qt 4.6.2 on Win XP.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T18:14:53+00:00Added an answer on May 20, 2026 at 6:14 pm

    The link delegation policy must be set appropriately for the linkClicked signal to be emitted.

    import sys
    
    from PyQt4.QtGui import *
    from PyQt4.QtCore import *
    from PyQt4.QtWebKit import QWebPage, QWebView
    
    app = QApplication(sys.argv)
    web_view = QWebView()
    web_view.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks)
    def url_changed(url):  print 'url changed: ', url
    def link_clicked(url):  print 'link clicked: ', url
    def load_started():  print 'load started'
    def load_finished(ok):  print 'load finished, ok: ', ok
    web_view.connect(web_view, SIGNAL("urlChanged(const QUrl&)"), url_changed)
    web_view.connect(web_view, SIGNAL("linkClicked(const QUrl&)"), link_clicked)
    web_view.connect(web_view, SIGNAL('loadStarted()'), load_started)
    web_view.connect(web_view, SIGNAL('loadFinished(bool)'), load_finished)
    web_view.load(QUrl('http://google.com'))
    web_view.show()
    sys.exit(app.exec_())
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: #!/usr/bin/env python import sys from PyQt4 import QtGui, QtCore
I'm trying to translate code from this thread in python: import sys from PyQt4.QtCore
Simple code demonstrating the problem: #!/usr/bin/env python import sys from PyQt4.QtCore import QObject, SIGNAL
import sys from apt.debfile import DebPackage deb = DebPackage(sys.argv[1]) print(deb.required_changes) I expected the above
from sys import exit from random import randint class Map(object): def death(): print quips[randint
The only nice way I've found is: import sys import os try: os.kill(int(sys.argv[1]), 0)
i have the following script import getopt, sys opts, args = getopt.getopt(sys.argv[1:], h:s) for
import sys words = { 1 : 'one', 2 : 'two', 3 : 'three',
If this is my subprocess: import time, sys for i in range(200): sys.stdout.write( 'reading
Why does the following print a blank line instead of 'Hello QProcess'? import sys

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.