PDA

View Full Version : lib using Image Collection



bitChanger
24th July 2006, 14:17
I've created a custom widget with a Qt Designer plugin using Qt 3.3.2
The custom widget has buttons that contain IconSet images. The images
were added to the .pro file and called in the code using ::fromMimeSource()

Compiling this project gives me a .lib file that I can include in other Qt projects to use my custom widget.

When using this custom widget the images never show up on the buttons. It seems to me that something must be done to get the images to the compiler of the new project that links in the .lib custom widget file.

Any suggestions?

wysota
24th July 2006, 17:14
How do you create the image collection?

bitChanger
24th July 2006, 19:48
In the .pro file I've added the line:
IMAGES = image1.png

Then in the .cpp file:
IconSet ico(QPixmap::fromMimeSource("image1.png"));

wysota
24th July 2006, 21:33
Maybe you should use IMAGES += xxx.png instead?

Chicken Blood Machine
25th July 2006, 18:30
It's a static instantiation problem that can happen when you have an image collection in a library. You must use the qInitImages_xxx() function to make sure the images get created:

http://lists.trolltech.com/qt-interest/2004-02/thread00291-0.html