Results 1 to 5 of 5

Thread: link from QTextBrowser to QWebView

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2008
    Posts
    16
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default link from QTextBrowser to QWebView

    hi!

    I've got an application which shows a list of links in QTextBrowser, but if the user clicks one of them I want them to appear in a different - QWebView, not in QTextBrowser, I want the QTextBrowser to remain the same.

    so I've done:

    Qt Code:
    1. QWebView *webview;
    2. QTextBrowser *browser;
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. connect(browser, SIGNAL(sourceChanged(QUrl &)), this, SLOT(showLink(QUrl &)));
    To copy to clipboard, switch view to plain text mode 

    and then:

    Qt Code:
    1. showLink(const QUrl &link)
    2. {
    3. webview->load(QUrl(link));
    4. webview->show();
    5. }
    To copy to clipboard, switch view to plain text mode 

    anyway it doesn't work.

    So I subclassed QTextBrowser and modified setSource() to do nothing. Still doesn't work...

    thanks for any help.
    Last edited by lamera; 9th October 2008 at 15:24.

Similar Threads

  1. QWebView - retrieving information?
    By lamera in forum Qt Programming
    Replies: 1
    Last Post: 25th September 2008, 17:53
  2. How to detect link added in QTextBrowser?
    By live_07 in forum Qt Programming
    Replies: 1
    Last Post: 8th July 2008, 05:40
  3. QTextBrowser - click on link - closes window
    By bruccutler in forum Newbie
    Replies: 2
    Last Post: 19th June 2007, 20:39

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.