New to list, make in applet (icon problem SOLVED)

David Baron d_baron at 012.net.il
Thu Dec 11 20:32:15 CET 2008


On Monday 08 December 2008 23:46:37 Aaron J. Seigo wrote:
> On Monday 08 December 2008, David Baron wrote:
> > On Monday 08 December 2008 21:33:21 David Baron wrote:
> > > On Monday 08 December 2008 19:04:17 Aaron J. Seigo wrote:
> > > > > > > Big outstanding issue is getting icons into the UI.
> > > >  > >
> > > >  > > use KIcon.
> > > >  >
> > > >  > Get the same crashes. KIcon will give me more flexibility and less
> > > >  > restrictions tied to resource folders, but it has to work first
> > > >  > :-)
> > > >
> > > > what are the crashes? you need to give us backtraces and example code
> > > > otherwise it's really hard to know what's going on ...
> > >
> > > The code is a simple pushButtonX->setIcon( KIcon( "nice-oxygen-icon");
> > >
> > > No useable backtraces. The example I posted was not from this crash.
> >
> > and of course, one better make sure that the set_ui (generated by the qt
> > designer) is called BEFORE trying to use any of those widgets, huh :-)
>
> hehe. yes, that's usually a good idea ;)
>
> > So I can use icons by name rather than by file-path/resource-path.
> > How might I do the same thing with the applet::svg images?
>
> you can install the svg using something like this in your CMakeLists.txt
> file:
>
> install( FILES <list of svgs> DESTINATION
> ${DATA_INSTALL_DIR}/desktoptheme/default/<pluginname> )
>
> and then you refer to them as "<pluginname>/<svgname>", leaving off the
> .svg or .svgz extension.

OK, but that is just another way of getting a specific path to specific files.
KIcon( "icon-name") will pull out the icon for the current KDE icon theme, 
i.e. oxygen. Changing that theme will show icons from the new theme.

Is there any way of linking these desktopthemes to KDE's.


More information about the Plasma-devel mailing list