KIcon / KIconEngine

Hamish Rodda rodda at kde.org
Sun Mar 19 14:11:41 GMT 2006


On Monday 20 March 2006 00:27, Michaël Larouche wrote:
> Le March 19, 2006 00:18, Hamish Rodda a écrit :
> > Hi,
> >
> > With the new one-icon-per-action-only design, there were troubles with
> > loading the correct size of icon to display for an action.  (To be fair,
> > this was partly due to KIconLoader still using QPixmaps).
> >
> > As a solution, I've created two new classes, KIcon and KIconEngine, and
> > renamed the old KIcon to K3Icon.  Some of these changes have been
> > discussed on the mailing list before, but I just wanted to run them past
> > everyone for comment before committing.
> >
> > I've not included the whole patch, because most of the KIcon -> K3Icon
> > diff is pretty mundane.  Instead, please find attached the new files, and
> > the diff to kaction which allows the old deprecated way of setting icon
> > names also use the new KIcon system.  One side effect of the patch is
> > that it is not possible to get the kde icon name back from a kaction or
> > qicon/kicon, because QIcon does not provide public access to the
> > QIconEngine it uses.  I don't see this as a problem though.
> >
> > At the moment the patch is suboptimal because KIcon should look to see if
> > we have already created a corresponding KIconEngine for the specified
> > icon name. This can be added later however.  Also planned for future
> > development is switching KIconLoader to just supply file names, and have
> > KIconEngine do the loading of the icon and (in the case of vector
> > graphics) rendering as required.
> >
> > I'd like this to go in before the next snapshot, so those porting to the
> > new KAction can also provide a KIcon("iconname") instead of using
> > deprecated constructors or the deprecated setIconName().
> >
> > Cheers,
> > Hamish.
>
> Why KIconEngine use a enum defined in K3Icon ?

Because I haven't ported KIconLoader to use QIcon::State instead of 
K3Icon::States.  There's a reasonable amount of rewriting / porting of 
KIconLoader required, but that will happen later.

Cheers,
Hamish.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060320/ec12b567/attachment.sig>


More information about the kde-core-devel mailing list