Results 1 to 12 of 12

Thread: Parse RSS into html and display it in QWebView.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Parse RSS into html and display it in QWebView.

    One way would be to take the output from rsslisting and generate a html page, then use webview to view that page.

  2. #2
    Join Date
    Mar 2010
    Posts
    34
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Parse RSS into html and display it in QWebView.

    Can you paste an simple exemple? I don't exactly know how...

  3. #3
    Join Date
    Aug 2007
    Posts
    166
    Thanks
    16
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Parse RSS into html and display it in QWebView.

    Are you sure you know how to program ? I really don't know how to put it simple, but here's your example:

    Qt Code:
    1. void RSSListing::itemActivated(QTreeWidgetItem * item)
    2. {
    3. QWebView* webview = new QWebView( this );
    4. webview->setWindowFlags( Qt::Window );
    5. webview->load( QUrl(item->text(1)) );
    6.  
    7. //QDesktopServices::openUrl(QUrl(item->text(1)));
    8. }
    To copy to clipboard, switch view to plain text mode 

    Now when you double click on item, it will open a QWebView window with the page you are looking for.

  4. #4
    Join Date
    Mar 2010
    Posts
    34
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Parse RSS into html and display it in QWebView.

    No im mean make it like firefox.

  5. #5
    Join Date
    Aug 2007
    Posts
    166
    Thanks
    16
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Parse RSS into html and display it in QWebView.

    Just wrap up the XML data in your custom HTML code, you can do that while parsing the RSS in parseXml(), and using some QString to put all the things togeder, then just grab that QString and show it in QWebView. Just add some check for the description too like:

    if (currentTag == "description")

    and voala, you have all the data you need, now you have to wrap it up in HTML tags. If you understand how to code HTML it should not be big deal.

Similar Threads

  1. Html page Display in QWebView
    By Tavit in forum Qt Programming
    Replies: 4
    Last Post: 10th July 2010, 15:39
  2. Reg QWebview Display
    By Tavit in forum Qt Programming
    Replies: 0
    Last Post: 5th August 2009, 15:19
  3. How to save a Qwebview as an html file
    By richardander in forum Qt Programming
    Replies: 2
    Last Post: 5th June 2009, 00:07
  4. Best way to load and parse an HTML file ??
    By tuthmosis in forum Qt Programming
    Replies: 8
    Last Post: 23rd August 2008, 11:06
  5. Display '<' as HTML in QString
    By mclark in forum Qt Programming
    Replies: 4
    Last Post: 6th July 2007, 21:43

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.