Results 1 to 2 of 2

Thread: Loading images from resource files in webkit

  1. #1
    Join Date
    Jan 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Loading images from resource files in webkit

    Hi

    I am trying to show an image on a local page... the image is stored in a resource file (images.res). I am not sure how should I override the QNetworkReply class to return the image specified.

    Any help is appreciated...

  2. #2
    Join Date
    Aug 2011
    Posts
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Loading images from resource files in webkit

    The most common approach to loading custom stuff into a WebView seems to be to implement a custom scheme handler in QNetworkAccessManager with a corresponding reply implementation. This is described a bit here, with demo: http://qt-project.org/forums/viewthread/12965

    You would then need to have your HTML files referring to the image or whatever using the new scheme:

    Qt Code:
    1. <img src="resource:///resources/images/amazing_horse.gif" />
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. How to compile qt resource files?
    By yangyunzhao in forum Qt Programming
    Replies: 1
    Last Post: 10th August 2009, 07:46
  2. Release build fails to find some resource images
    By MrGarbage in forum Installation and Deployment
    Replies: 3
    Last Post: 8th December 2007, 17:04
  3. Dynamic resource loading not work in another computer
    By GRUB in forum Installation and Deployment
    Replies: 2
    Last Post: 3rd September 2007, 11:49
  4. Loading images in QTextBrowser
    By nisha0609 in forum Qt Programming
    Replies: 1
    Last Post: 3rd January 2007, 10:44

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.