PDA

View Full Version : QListWidget painting issue



guilugi
6th April 2007, 14:56
Still experiencing problems with QListWidget (QTableWidget also) and Qt4.2.x...
I hope this will be corrected with Qt 4.3.

Here's a bug that appear when I refresh my view (simple QListWidget in IconMode), labels layout is quite messy...as the screenshot show :)

Any of you experienced that ?
It occurs on Linux, I'll have to check on Windows too.

Regards,
Guilugi.

jpn
12th April 2007, 18:15
Could you provide a minimal compilable example reproducing the problem? ;)
Is there anything "custom" involved or are those plain QListWidgetItems?

guilugi
12th April 2007, 22:10
Yes, I will post it tomorrow...

In fact, those items correspond to the images contained in a directory...

1) I create & add all the items with a unique default pixmap.

2) In a separate thread, I have an ImageMagick module that process thumbnails (it allows me to support a lot of formats :) ), and I emit a reference of the thumbnail once it's ready.
I also add the thumbnail in a custom cache file.

3) I update the corresponding item with this new thumbnail.

The bug always appears when I "refresh" the view (clear()+ reloading of images, fast via cache), except when I set setUniformSizes(true).

Unfortunately (and logically), this last option provoke new issues when I have thumbnails of various sizes.

Thanks for replying ;)

Guilugi.

guilugi
13th April 2007, 15:08
Okay, here is an example I just wrote, I can reproduce my bug with it.

It is an imageviewer based on a qtreeview to browse local disks, and a listwidget to display thumbnails.

I'm using a QThread subclass dedicated to process the thumbnails smoothly (in fact, I use magick code, but here, I made an ugly Qt version :p ) : it emits a signal once an image is ready, and the corresponding item is being updated.

Here, I can easily reproduce the bug on any directory that contain images...
Randomly, the app crashes, because I don't handle really well the thread (I made it really quickly) : it crashes sometimes when you change directory while the thread is processing..)

Hope some of you can confirm the visual issue ONLY :D

Guilugi.

jpn
13th April 2007, 15:36
Hope some of you can confirm the visual issue ONLY :D
Sorry, no luck. The attached screenshot was taken with Qt 4.2.3 on X11.

guilugi
13th April 2007, 15:38
Ok, thanks...It must really be my distrib...I'm checkin on Win32 right now.

EDIT : I just compiled this example with Qt 4.2.3 on my WinXP computer, it's also quite messy.

I'm posting to Trolltech ;-)

Thanks for your help Jpn

guilugi
16th April 2007, 17:06
Okay, this issue will probably be rejected by Trolltech..

I just purged all my Debian Qt4 packages, and compiled my own 4.3.0 version, and it's much much better, this particular issue has disappeared ;)