Creating a public pixmap overlays method based on icon overlays?

Matthias Fuchs mat69 at
Thu Jun 2 21:53:55 BST 2011


I was looking at BUG:190579 [1] and realised that there is a general problem 
in KDE that does not only apply to folders:
As soon as you have preview enabled you won't get any more icon overlays for 
images, no matter if you look at images directly or at folders containing 
images (the later most likely because the previews are pointed over the 

So I thought what should be done is to also display overlays for previews. Yet 
the overlay method only applies to icons at the moment. [2]

The code that is used [3] can be easily adpated to pixmaps not having the same 
width and height. [4]
I even tried it and it looks good enough in my opinion.

Now I need your feedback:
Should a more general method like that be added?
Should that method be used for previews and also KIconLoader?
And where should such a method be placed, I mean in which header?


[2] KIcon (const QString &iconName, KIconLoader *iconLoader, const QStringList 
&overlays) and KIconLoader::loadIcon
[3] KIconLoaderPrivate::drawOverlays at kiconloader.cpp:357
[4] something like:
const int height = pix.size().height();
const int width = pix.size().width();
const int iconSize = qMin(width, height);
and then using height/width instead of iconSize for the x/y values of the 
following QPoints.

More information about the kde-core-devel mailing list