tags:

views:

427

answers:

2

I'm using the newest Qt 4.5 and I'm creating my GUI with Qt Creator. My tab widget looks fine in the Creator, with all icons displayed. However, when I compile it and run it, there are no icons, but the tabs are wider than they are which indicates something, obviously. I tried both .png and .ico formats, none work. The size of icons is 16x16, exactly as the maximum tab icon size property.

The stylesheet to the tab control is not applied (nor there is any), except the 'general style' which is 'clearlooks'.

It's kinda urgent ... so please help (:

+1  A: 

maybe you have to put the icons near your binary file?

oryou can place your resource directory near your binary file..

if you are using windows, you can check with Filemon if it finds icons?

ufukgun
+1  A: 

Your icons probably can't be found by your executable. Try embedding them using the Qt resource system, this is how they are usually distributed.

Otherwise you need to check your paths are correct from whatever working directory you are running the executable from.

Mike McQuaid
It's weird that they cannot be found ... the path to the icons is not relative; it's absolute. It's like C:\\icon.png.
Ahmed
Perhaps Qt would prefer C:/icon.png ? IIRC Qt likes to use forward slashes in its paths, even on Windows...
Jeremy Friesner
Tried that too. Didn't work :/
Ahmed