Results 1 to 20 of 28

Thread: QWebview not showing images

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2007
    Posts
    106
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default QWebview not showing images

    Hi!

    I am trying QT 4.4 tecnology preview for webkit to have full html functionality in my application. It does not display images!! Any help why?

    Regards,
    Manoj

  2. #2
    Join Date
    Aug 2006
    Posts
    83

    Default Re: QWebview not showing images

    I'm sorry that I don't have an answer for you, but maybe it doesn't work, because it still is a technology preview ?

  3. #3
    Join Date
    May 2007
    Posts
    106
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: QWebview not showing images

    but why is it so that it shows the images in online page but not offline? i.e. If I show the page "http://www.yahoo.com" it shows perfectly but if I save the same page in html format along with its all images, it shows everything except images???

    I am stuck here with this!! please help!!

  4. #4
    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: QWebview not showing images

    How do the links look like? What is current working directory?
    J-P Nurmi

  5. #5
    Join Date
    May 2007
    Posts
    106
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: QWebview not showing images

    Current working directory is the directory where I am executing my project from! There are very funny things happening:
    (1) It shows the online page perfectly.
    (2) It does not show the offline images.
    (3) It shows the images from some server in offline pages but that too only when I load the page with setHtml() function, not with load() function!!

    How do I get it done??

  6. #6
    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: QWebview not showing images

    Could you answer the questions, please?
    • What does
      Qt Code:
      1. qDebug() << QDir::currentPath();
      To copy to clipboard, switch view to plain text mode 
      output?
    • In saved HTML page, what do missing images have as img-elements src attribute?
      <img src="..."/>
    J-P Nurmi

  7. #7
    Join Date
    May 2007
    Posts
    106
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: QWebview not showing images

    Hi!

    The current Path returns:
    C:/HTMLViewer

    The image source is:
    "img1.jpg"

    I am passing html/test.htm as path for url and img1.jpg is stored in html folder.

    BTW: Image is displayed if I give the src as: ftp::///C:/HTMLViewer/html/img1.jpg but I don't want to specify absolute paths here.

  8. #8
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QWebview not showing images

    Did you compile Qt with .jpg support?
    Qt 5.3 Opensource & Creator 3.1.2

  9. #9
    Join Date
    May 2007
    Posts
    106
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: QWebview not showing images

    Quote Originally Posted by MarkoSan View Post
    Did you compile Qt with .jpg support?
    I compiled QT with GIF support and I think that it is always compiled with jpg and mng support by default. I also told you that it is displaying images if I give the online location of images or the full absolute location with FTP.

  10. #10
    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: QWebview not showing images

    So it was about current working directory after all. src="image.png" means that the image is searched from the current directory. I don't know if there is a possibility to set search paths or something, but presumably the images are shown once you launch the application from C:\HTMLViewer\html or you change it to src="html/image.png".
    J-P Nurmi

  11. #11
    Join Date
    May 2007
    Posts
    106
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: QWebview not showing images

    Quote Originally Posted by jpn View Post
    So it was about current working directory after all. src="image.png" means that the image is searched from the current directory. I don't know if there is a possibility to set search paths or something, but presumably the images are shown once you launch the application from C:\HTMLViewer\html or you change it to src="html/image.png".
    No, it does not work that way even.

  12. #12
    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: QWebview not showing images

    Quote Originally Posted by manojmka View Post
    No, it does not work that way even.
    So, exactly what did you try? It might prove to be useful to be as detailed as possible. "My car does not work" is not very useful information to a car mechanic. Does it print any warnings to debug output (provided that you have QT += console)?
    J-P Nurmi

  13. #13
    Join Date
    May 2007
    Posts
    106
    Thanked 3 Times in 3 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Re: QWebview not showing images

    Well, I think I tried to write in detail but may be you can tell me what details are you expecting?

    I have already stated that:
    (1) It shows the online page perfectly.
    (2) It does not show the offline images.
    (3) It shows the images from some server in offline pages but that too only when I load the page with setHtml() function, not with load() function!!
    (4) It also show the images from disk if I give them as: <img src=FTP:///C:/HTMLViewer/html/img1.jpg">

Similar Threads

  1. about qt/embedded widgets showing in ARM platform
    By xianshuiren in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 3rd December 2007, 05:48
  2. Problem showing raw images
    By wkit23 in forum Qt Programming
    Replies: 5
    Last Post: 8th September 2006, 13:33

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.