Results 1 to 2 of 2

Thread: Embedding images in a Qt3 application

  1. #1
    Join Date
    Aug 2006
    Posts
    163
    Thanks
    12
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Embedding images in a Qt3 application

    I just found out that Qt3 doesn't have the nifty qresource application that Qt4 has, so I did a little digging and found out that you can embed images using

    Qt Code:
    1. uic -embed <project? <image> -o somefilename.cpp
    To copy to clipboard, switch view to plain text mode 

    What I can't figure out from there is how to initialize this and what you need to call to access the images that were now compiled into your program. Can anyone tell me how?

    Thanks in advance.

  2. #2
    Join Date
    Aug 2006
    Posts
    163
    Thanks
    12
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Exclamation Re: Embedding images in a Qt3 application

    Ugh, that's the second time this week that, after spending some time on a problem, I hit upon the answer seconds after hitting the submit button

    The solution is, generate the file as a header file, then include that wherever you want to use the images. Then call the

    Qt Code:
    1. uic_findImage( "imagename.extention" )
    To copy to clipboard, switch view to plain text mode 
    which will return a QImage. You can use that in your application then.

    For some strange reason the normally excellent Qt documentation hardly documented this function at all...

Similar Threads

  1. QSkinWindows Classes
    By kernel_panic in forum Qt-based Software
    Replies: 45
    Last Post: 20th April 2010, 12:35
  2. dll + application
    By fpujol in forum Qt Programming
    Replies: 11
    Last Post: 15th April 2007, 18:37
  3. Replies: 3
    Last Post: 8th December 2006, 18:51
  4. Embedding binary data into an application
    By Valheru in forum Qt Programming
    Replies: 5
    Last Post: 1st September 2006, 14:23

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.