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 3783702
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:15:52+00:00 2026-05-19T11:15:52+00:00

I open a web page with QWebView.load(QUrl(myurl)) , the webpage gets some input and

  • 0

I open a web page with QWebView.load(QUrl(myurl)) , the webpage gets some input and returns a new php generated page.

If executed in Firefox the browser automatically opens a new tab/window to show the returned page.

How to tell QWebView to open a new instance of QWebview with the returned data loaded?

I was looking at at the QwebView documentation at
http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qwebview.html … but no joy.

Example of such a page :
http://www.iqfront.com/index.php?option=com_content&view=article&id=5&Itemid=4

Thanks for any ideas.

  • 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-19T11:15:53+00:00Added an answer on May 19, 2026 at 11:15 am

    from my understanding this is developer’s job to create and open new tabs for urls clicked.You would need to define a custom slot for QWebView::linkClicked signal. 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. There you can create a new instance of QWebView add it a tab and open new url there. Below is an example:

    import sys
    from PyQt4 import QtGui, QtCore, QtWebKit 
    
    class MainForm(QtGui.QMainWindow):
        def __init__(self, parent=None):
            super(MainForm, self).__init__(parent)
    
            self.tabWidget = QtGui.QTabWidget(self)        
            self.setCentralWidget(self.tabWidget)        
            self.loadUrl(QtCore.QUrl('http://qt.nokia.com/'))
    
        def loadUrl(self, url):    
            view = QtWebKit.QWebView()  
            view.connect(view, QtCore.SIGNAL('loadFinished(bool)'), self.loadFinished)
            view.connect(view, QtCore.SIGNAL('linkClicked(const QUrl&)'), self.linkClicked)
            view.page().setLinkDelegationPolicy(QtWebKit.QWebPage.DelegateAllLinks)
            self.tabWidget.setCurrentIndex(self.tabWidget.addTab(view, 'loading...'))
            view.load(url)
    
        def loadFinished(self, ok):
            index = self.tabWidget.indexOf(self.sender())
            self.tabWidget.setTabText(index, self.sender().url().host())
    
        def linkClicked(self, url):        
            self.loadUrl(url)
    
    def main():
        app = QtGui.QApplication(sys.argv)
        form = MainForm()
        form.show()
        app.exec_()
    
    if __name__ == '__main__':
        main()
    

    hope this helps, regards

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I open a web-page and receive its cookies using PHP? The motivation
I'm trying to open a web page using QNetworkAccessManager - and for some pages
How can I execute links2 to open a web page and locate and click
How would you make a button in cocoa when clicked open a web page?
I have a web page which contains a select box. When I open a
How can you open windows program by pressing a button on web page I
I have a requirement to allow users to open word document from web page
In a VS2008 web site project, I have a page open in split view.
I want to open a webpage in internet explorer and navigate to a page
Try to open my web-page on vds and then get: We're sorry, but something

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.