PDA

View Full Version : Toolbar action icons disappear under Ubuntu 12.04



gib
10th September 2012, 02:55
I have just ported my Qt program from Windows (where I use Qt 4.6) to Ubuntu 12.04 (where I use Qt 4.8). The program works fine in Windows, but in Ubuntu there is a problem with the toolbar icons. The icons are all visible in Designer, and when I view the .qrc file in the Qt Creator editor, but at runtime they do not display. I have checked that the .cpp file generated from icons.qrc is the same for both OSs. Any suggestions?
Thanks
Gib

ChrisW67
10th September 2012, 06:53
Here are some guesses:

The image format plugin needed for the icon images is not present in your run time environment
The paths to icons in the program are not referencing the resource file, e.g "images/file.png" vs. ":images/file.png", and only worked by accident on Windows. The build directory structure is generally different between Windows and Unix so files accessed by relative paths may not be where you expect.

gib
10th September 2012, 09:45
Here are some guesses:

The image format plugin needed for the icon images is not present in your run time environment
The paths to icons in the program are not referencing the resource file, e.g "images/file.png" vs. ":images/file.png", and only worked by accident on Windows. The build directory structure is generally different between Windows and Unix so files accessed by relative paths may not be where you expect.


Thanks for responding.

The images are .png. They display correctly everywhere, as far as I can tell, e.g. they show up in Qt Designer. Qt examples that use .png icon files all display the icons correctly, which makes me think that any needed plugin is present. If I'm wrong, how can I check that the image format plugin is present? I thought of using these examples (e.g. the Application example) to help resolve this issue, but these are not directly comparable with what I'm doing, because I am generating a form as a .ui file using Designer, while the examples all seem to build the UI programmatically.

The paths to the icon files are correctly referenced in the resource file, and the file qrc_icons.cpp that is automatically generated from them is the same as that generated on Windows.