KIconLoader

Lynn Hazan lynn.hazan at lsce.ipsl.fr
Thu Jan 7 13:43:35 GMT 2010


If anyone can help me on the following topic I will really appreciate as I 
have been fighting with for days.

I just want to specify my own icons and cursors. I did it without any problem 
using KDE3 but with KDE4 I can not manage to do it. The only thing I can get 
is the unknow icon (
/usr/lib/kde4/share/icons/oxygen/16x16/mimetypes/unknown.png).
I am sure it is pretty easy to do when you know how.

Here is what I did : 

* create an icons directory in my source directory
* add an icon (zoom_tool.png) in this directory
 * update my CMakeLists.txt:
	install( FILES icons/zoom_tool.png  DESTINATION 
${DATA_INSTALL_DIR}/calibrationcontrol/icons 
	
	#with or without the following line it does not work
	kde4_install_icons( ${ICON_INSTALL_DIR}   )

* try to upload the icon in my code:
KIconLoader *loader = KIconLoader::global();
KAction* selectAction = new KAction(this);
  selectAction->setIcon(KIcon(loader->loadIcon("zoom_tool", 
KIconLoader::NoGroup)));
....

I also tried with KIconLoader::User

Thanks in advance.

Lynn




More information about the kde-core-devel mailing list