PDA

View Full Version : Embedding images in a Qt3 application



Valheru
20th November 2007, 20:14
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


uic -embed <project? <image> -o somefilename.cpp

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.

Valheru
20th November 2007, 20:25
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 :p

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


uic_findImage( "imagename.extention" ) 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...