[KPhotoAlbum] suggested solution to the icon problem

Johannes Zarl-Zierl johannes at zarl-zierl.at
Fri Jan 5 00:01:59 GMT 2018

Hi Anreas,

On Donnerstag, 4. Jänner 2018 19:48:34 CET Andreas Schleth wrote:
> > I'm still wondering how this happens in the first place: 
> > [...]
> > Yet, the displayed pixmap has (by the way of a screen ruler) ~20px in
> > height.
> Yes, this is approximately the height of the text line. If I introduce
> just one icon 64x64 für the thumbnail view via a fallback, all the other
> items show (more or less) OK, except for the missing icons. It might be
> a QT issue with QListView.

"Height of the text line" was a good clue, and now I think I have an idea 
what's happening:
Because the item "view-preview" (i.e. thumbnail view) is missing, it falls 
back to text view. It seems that the QListView in Qt 5.5 then assumes that all 
items have only the DisplayRole instead of DecorationRole.

Forcing the issue in Qt 5.9 by setting an invalid icon did not work.

> I opted for the QLatin1String because that would make it clearer, that
> this is a fixed string, that does not need translation. I was just
> confused because of the mixture of ::fromUtf8 and ::fromLatin1.


> Could You show me, how to add ressources to KPA and how to call them?

I have to admit I did not use resources with a cmake-based Qt project before. 
I need to take a look myself…


More information about the Kphotoalbum mailing list