PDA

View Full Version : Static linking images?? What's wrong?



obquty
17th May 2010, 19:58
Hi,
i have problem with linking images to my program, so mayby somebody can help me.

I have:
- QLabel -> Label
- QImage -> Image
- QComboBox -> Box

I load example image to "Image",next i use function setPixmap on Label and choose "Image".
Next i add options (1,2,3) to "Box"
If i choose 1 i see first image,if 2 second and if 3 third.
Every time when i choose something from "Box" i load to "Image" new image,and refresh Label putting a new loaded image.
It is ok when i compile it and use on QtCreator but...
If i compile my program in release mode,and put exe file(with images) in output folder with "dll" files to run it without using a QtCreator it doesn't work.
A place where should be image is always black.
How i must compile this project to use this file without images in output folder(mayby something like static linking) or in the end what to do to this work.?

It is a example how i load images:

first_image.load ("foto.jpg");
I put images in the same folder what exe file.
Please help.

Zlatomir
17th May 2010, 20:04
Read about Qt's resource system (http://doc.trolltech.com/4.6/resources.html)