PDA

View Full Version : QListWidget / QListView Bug ?



guilugi
10th November 2006, 09:09
Hello !

I've just ported my application to Qt 4.2, and I'm experiencing a strange visual issue with QListWidget...

Basically, I use this class to display thumbnails for directories : simple, an item, with an icon and a small text (filename).

As you can see on the screenshot I attached, text labels are some kind of "sticked" to the icon since 4.2, and before, all the labels were aligned with the base of a row...

I tried to use setTextAlignment to change label position, but is has no effect (vertically).

Even in Designer, this issue can be seen!

Any idea ?

Thanks,

Guilugi.

e8johan
12th November 2006, 10:27
An easy (ugly?) fix would be to generate square pixmaps for all icons by putting white space over all non-square pixmaps... but that would mean the selections will look bad.

guilugi
13th November 2006, 13:25
Yeah...I refuse to do that.

I think I'll stay with Qt 4.1 until it's fixed !

Thanks for answering,

Guilugi.

PS : I posted this bug on Trolltech's Task Tracker

wysota
13th November 2006, 15:39
The problem is probably with the item delegate. You might just substitute it with your own which should work fine until the fix is found.

guilugi
14th November 2006, 11:05
Thanks for replying Wysota, I'll try this!

guilugi
16th November 2006, 11:33
Ok,

A Trolltech engineer has answered me, here is the interesting quote!

"> Regarding the issue you have reported I am afraid that it is an
> > intented behavior change in Qt4.2 for QListView and how text and
> > pixmaps are drawn. The pixmap size is retrieved and and we are using
> > this size to setup the margins and where the text will be drawn."

I subclassed QItemDelegate, trying to override this behavior, but it was not really succesful :(

I keep investigating :p
Guilugi.