Results 1 to 2 of 2

Thread: QWebPage Intercept the action OpenLinkInNewWindow, and Open the url In my own Window.

  1. #1
    Join Date
    Jun 2010
    Posts
    38
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    3

    Default Re: QWebPage Intercept the action OpenLinkInNewWindow, and Open the url In my own Win

    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:

    Qt Code:
    1. QWebView window = new QWebView;
    2. window->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
    3. connect(window->page()->action(QWebPage::OpenLinkInNewWindow),SIGNAL(triggered()),this,SLOT(handleOpenInNewWindowRequest()));
    To copy to clipboard, switch view to plain text mode 

    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".
    Last edited by wookoon; 29th October 2013 at 05:24.

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

    Default Re: QWebPage Intercept the action OpenLinkInNewWindow, and Open the url In my own Win

    I think you need to connect to the linkClicked() signal.

    Cheers,
    _

Similar Threads

  1. Replies: 2
    Last Post: 14th January 2013, 08:07
  2. Intercept windows open folder
    By nasiroudin in forum Qt Programming
    Replies: 3
    Last Post: 12th February 2012, 20:49
  3. Open new window on menu action.
    By l0ner in forum Newbie
    Replies: 0
    Last Post: 19th June 2011, 20:01
  4. Replies: 1
    Last Post: 3rd December 2009, 11:15
  5. Intercept minimize window event
    By vereteran in forum Newbie
    Replies: 8
    Last Post: 17th October 2009, 07:33

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
  •  
Qt is a trademark of The Qt Company.