Results 1 to 2 of 2

Thread: Can QTextBrowser display remote images?

  1. #1
    Join Date
    Dec 2008
    Location
    Isfahan (Iran)
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Can QTextBrowser display remote images?

    I use a QTextBrowser in my code, and pass an html text to it via QTextBrowser::setHtml() function.
    but it can't display images on the web, for example, when I pass this text to the above function:
    Qt Code:
    1. <p><img src="http://i39.tinypic.com/2cqlhtg.jpg" /></p>
    To copy to clipboard, switch view to plain text mode 

    just an file icon will be showed in the QTextBrowser, not the image itself.
    but it can display images on local computer, even when the image path starts with "file://" prefix.

    after all, is there any flag which I should set to make QTextBrowser get the image data automatically? or is there any similar qt widget which I can use instead?
    I know QWebView can display both local and remote images, but I need a widget with ability to edit its content.

    thanks.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Can QTextBrowser display remote images?

    Unfortunately QTextBrowser can show local images only. However, there's a way to load remote files yourself via QTextBrowser::loadResource(). See QTextEdit and delayed image loading for more details.
    J-P Nurmi

Similar Threads

  1. How to display a images use mosaic foramt?
    By longtrue in forum Qt Programming
    Replies: 2
    Last Post: 13th May 2008, 08:40
  2. Loading images in html in a QTextBrowser
    By BasicPoke in forum Newbie
    Replies: 1
    Last Post: 6th June 2007, 21:51
  3. Display multiple Images in a widget
    By jeetu_happy in forum Qt Programming
    Replies: 2
    Last Post: 7th March 2007, 11:24
  4. How to display images in QTextBrowser ?
    By probine in forum Qt Programming
    Replies: 1
    Last Post: 12th January 2007, 08:58

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.