PDA

View Full Version : QWebPage Intercept the action OpenLinkInNewWindow, and Open the url In my own Window.



wookoon
29th October 2013, 04:24
Hi,all,
I want intercept the action OpenLinkInNewWindow, and open the url in my own window. How can I do?

I have try like this:



QWebView window = new QWebView;
window->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks );
connect(window->page()->action(QWebPage::OpenLinkInNewWindow),SIGNAL(trigg ered()),this,SLOT(handleOpenInNewWindowRequest())) ;


Is my way right?

Added after 1 17 minutes:

I will do a application base on videos website. So my application can show webpage. All the pages will show in my application, If user click a video link and want to play it, and then this page will be open in my player, (so I need analyse the link whether include a video source),and this player is base on webpage too. You can think it as a browser too. It's different with the main application is in the UI.

So my question above is just for "openning a video link in my player".

anda_skoa
29th October 2013, 07:45
I think you need to connect to the linkClicked() signal.

Cheers,
_