Results 1 to 4 of 4

Thread: QWebView + img + OSx

  1. #1
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default QWebView + img + OSx

    Hi,

    I have a search.png file on my app's current directory.

    this:

    Qt Code:
    1. QWebView * web = new QWebView;
    2.  
    3. web->setHtml("<img src=\"search.png\">");
    To copy to clipboard, switch view to plain text mode 

    Doesn't show the picture, since 4.6.

    Am I missing something ?

  2. #2
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QWebView + img + OSx

    Quote Originally Posted by bunjee View Post
    Am I missing something ?
    Maybe imageformats plugins?
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  3. #3
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Re: QWebView + img + OSx

    "file://" + fullPath seems to work.

    Indeed, relative path seems to be what's broken.

  4. #4
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Re: QWebView + img + OSx

    This :

    Qt Code:
    1. QWebView * web = new QWebView;
    2.  
    3. web->setHtml("<img src=\"search.png\">", QDir::currentPath() + '/');
    To copy to clipboard, switch view to plain text mode 

    Works in 4.5 and not in 4.6. I'm not sure why.

Similar Threads

  1. QWebView too slow
    By URPradhan in forum Qt Programming
    Replies: 9
    Last Post: 23rd March 2012, 11:13
  2. Replies: 3
    Last Post: 20th April 2010, 16:49
  3. Problem With QWebView
    By ivi2501 in forum Qt Programming
    Replies: 8
    Last Post: 2nd August 2009, 19:37
  4. QWebView transparent problem
    By embedyy in forum Qt Programming
    Replies: 4
    Last Post: 16th January 2009, 06:20
  5. QWebView - retrieving information?
    By lamera in forum Qt Programming
    Replies: 1
    Last Post: 25th September 2008, 17:53

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.