[Kde-bindings] C#, Qyoto, Qt - How to add icons to project?

linuxoidoz at yahoo.com.au linuxoidoz at yahoo.com.au
Sat Feb 20 04:35:15 UTC 2010


Hello,

I have a few icons which I add to my buttons:

	public QIcon iconVideo;
	public QIcon iconAudio;
	public QIcon iconImage;
	...
		iconVideo = new QIcon("icons/video.svg");
		iconAudio = new QIcon("icons/audio.svg");
		iconImage = new QIcon("icons/image.svg");

		btnVideo = new QPushButton(iconVideo, "", this);
		btnAudio = new QPushButton(iconAudio, "", this);
		btnImage = new QPushButton(iconImage, "", this);

I store the icons in the project/icons folder + I also added the icons to the /bin/Debug/icons/ just in case.

When I build and run the project, the application shows the icons fine. But when I run the executable by itself, none of the icons show up. I've tried a few things but none worked.

1. I added the /icons folder to the project and tried different build actions - no icons
2. I made a resources.qrc file:

<!DOCTYPE RCC><RCC version="1.0">
 <qresource>
     <file>icons/video.svg</file>
     <file>icons/audio.svg</file>
     <file>icons/image.svg</file>
 </qresource>
 </RCC> 

then compiled it with 'csrcc -o resources.cs resources.qrc', added the resources.cs file to the project - still no icons.

Please help. Thank you.



More information about the Kde-bindings mailing list