PDA

View Full Version : How to emulate linkClicked(QUrl) signal in QWebEnginePage similar to QWebPage



ejoshva
2nd May 2015, 08:09
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).


void authenticationRequired(const QUrl & requestUrl, QAuthenticator * authenticator)
void featurePermissionRequestCanceled(const QUrl & securityOrigin, QWebEnginePage::Feature feature)
void featurePermissionRequested(const QUrl & securityOrigin, QWebEnginePage::Feature feature)
void geometryChangeRequested(const QRect & geom)
void iconUrlChanged(const QUrl & url)
void linkHovered(const QString & url)
void loadFinished(bool ok)
void loadProgress(int progress)
void loadStarted()
void proxyAuthenticationRequired(const QUrl & requestUrl, QAuthenticator * authenticator, const QString & proxyHost)
void selectionChanged()
void titleChanged(const QString & title)
void urlChanged(const QUrl & url)
void windowCloseRequested()


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

How to emulate linkClickedSignal(QUrl)

Any help will be of great use. Thanks

anda_skoa
2nd May 2015, 08:57
My guess would be that the signal you are looking for is urlChanged().

Cheers,
_

ejoshva
2nd May 2015, 09:45
url(Changed) doesn't passes the href clicked. It just passes the url of the currently loaded page. :(

anda_skoa
2nd May 2015, 11:39
What if you read the requestedUrl when the signal occurs?

Cheers,
_

ejoshva
2nd May 2015, 12:09
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