Results 1 to 5 of 5

Thread: How to emulate linkClicked(QUrl) signal in QWebEnginePage similar to QWebPage

  1. #1
    Join Date
    Feb 2015
    Posts
    185
    Thanks
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default How to emulate linkClicked(QUrl) signal in QWebEnginePage similar to QWebPage

    I am porting from QGraphicsWebView from QWebEngineView

    I want to emit linkClicked(QUrl) signal, when a href is clicked on the QWebEnginePage similar to the ones found in QWebPage.

    The signals found in QWebEnginePage are as below but not able to find linkClicked(QUrl).
    Qt Code:
    1. void authenticationRequired(const QUrl & requestUrl, QAuthenticator * authenticator)
    2. void featurePermissionRequestCanceled(const QUrl & securityOrigin, QWebEnginePage::Feature feature)
    3. void featurePermissionRequested(const QUrl & securityOrigin, QWebEnginePage::Feature feature)
    4. void geometryChangeRequested(const QRect & geom)
    5. void iconUrlChanged(const QUrl & url)
    6. void linkHovered(const QString & url)
    7. void loadFinished(bool ok)
    8. void loadProgress(int progress)
    9. void loadStarted()
    10. void proxyAuthenticationRequired(const QUrl & requestUrl, QAuthenticator * authenticator, const QString & proxyHost)
    11. void selectionChanged()
    12. void titleChanged(const QString & title)
    13. void urlChanged(const QUrl & url)
    14. void windowCloseRequested()
    To copy to clipboard, switch view to plain text mode 

    http://doc.qt.io/qt-5/qwebenginepage.html

    How to emulate linkClickedSignal(QUrl)

    Any help will be of great use. Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to emulate linkClicked(QUrl) signal in QWebEnginePage similar to QWebPage

    My guess would be that the signal you are looking for is urlChanged().

    Cheers,
    _

  3. #3
    Join Date
    Feb 2015
    Posts
    185
    Thanks
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: How to emulate linkClicked(QUrl) signal in QWebEnginePage similar to QWebPage

    url(Changed) doesn't passes the href clicked. It just passes the url of the currently loaded page.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to emulate linkClicked(QUrl) signal in QWebEnginePage similar to QWebPage

    What if you read the requestedUrl when the signal occurs?

    Cheers,
    _

  5. #5
    Join Date
    Feb 2015
    Posts
    185
    Thanks
    5
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: How to emulate linkClicked(QUrl) signal in QWebEnginePage similar to QWebPage

    I am able to navigate to the page , when the link is clicked(). Here it happens implicitly unlike QGraphicsWebView where in we have to capture the url on clicking the link and set again to the webview.

    Now the issue for me is , the link is a download link

Similar Threads

  1. Replies: 2
    Last Post: 26th February 2015, 08:53
  2. linkCLicked Signal .
    By divanshu in forum Newbie
    Replies: 2
    Last Post: 5th July 2011, 06:28
  3. linkClicked signal
    By maston in forum Qt Programming
    Replies: 13
    Last Post: 7th September 2010, 20:26
  4. QWebpage always return false for signal loadfinished
    By QtVenkat in forum Qt Programming
    Replies: 0
    Last Post: 4th June 2010, 20:50
  5. QWebPage::linkClicked() is only emitted once
    By Lykurg in forum Qt Programming
    Replies: 0
    Last Post: 20th November 2008, 12:56

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.