You are not logged in.

Dear visitor, welcome to If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.


Tuesday, January 11th 2005, 6:25am

QPixmap in QListBox

I am doing the following:


Using the above method I am loading 6 pixmaps in the listBox.
I am using QT on Linux. I compile my program using

qmake -makefile
and then execute it using

In the above case everything works fine. I can see the pixmaps in the listbox.

However instead of "./project", if I directly double click on the executable file created, the pixmaps cannot be seen in the listbox at all.
All functionalities work fine execpt for those concerning pixmaps.. for eg "setPixmap" on textLabel does not work.
Am I loading the pixmaps correctly?
Thank you for your help..

  • "Petr Svetr Killometr" is male

Posts: 55

Location: Czech Republic

  • Send private message


Tuesday, January 11th 2005, 6:48am

RE: QPixmap in QListBox

Try to use absolute file path, when you loading the images.



Posts: 55

Location: Vancouver, BC, Canada

Occupation: Biologist

  • Send private message


Wednesday, January 12th 2005, 3:01am

RE: QPixmap in QListBox

If you load bitmap resources into your program using their filenames, they will need to be in the correct location (i.e. the correct folder relative to the application), as mandira said.

If you use absolute paths it will work, but it's a bit unreliable if you wish to distribute the app to other users, because they can and will move or rename folders, and at some point your images will vanish.

I prefer to use uic or qembed to load the required bitmaps into a c++ file that is compiled directly into the executable.

This link might be useful: but it doesn't mention uic (which I have found to be the best method)

Good luck