Results 1 to 7 of 7

Thread: QListWidget painting issue

  1. #1
    Join Date
    Jan 2006
    Location
    Paris, France
    Posts
    227
    Thanks
    3
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QListWidget painting issue

    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.
    Attached Images Attached Images

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QListWidget painting issue

    Could you provide a minimal compilable example reproducing the problem?
    Is there anything "custom" involved or are those plain QListWidgetItems?
    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Location
    Paris, France
    Posts
    227
    Thanks
    3
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QListWidget painting issue

    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.

  4. #4
    Join Date
    Jan 2006
    Location
    Paris, France
    Posts
    227
    Thanks
    3
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QListWidget painting issue

    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 ) : 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

    Guilugi.
    Attached Files Attached Files

  5. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QListWidget painting issue

    Quote Originally Posted by guilugi View Post
    Hope some of you can confirm the visual issue ONLY
    Sorry, no luck. The attached screenshot was taken with Qt 4.2.3 on X11.
    Attached Images Attached Images
    J-P Nurmi

  6. The following user says thank you to jpn for this useful post:

    guilugi (13th April 2007)

  7. #6
    Join Date
    Jan 2006
    Location
    Paris, France
    Posts
    227
    Thanks
    3
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QListWidget painting issue

    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
    Last edited by guilugi; 13th April 2007 at 15:42.

  8. #7
    Join Date
    Jan 2006
    Location
    Paris, France
    Posts
    227
    Thanks
    3
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QListWidget painting issue

    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

Similar Threads

  1. custom painting in QListWidget
    By Andrew in forum Qt Programming
    Replies: 21
    Last Post: 30th March 2007, 13:16
  2. Mouse Drag selction Issue in QListWidget
    By vishal.chauhan in forum Qt Programming
    Replies: 5
    Last Post: 21st February 2007, 08:55
  3. Replies: 13
    Last Post: 15th December 2006, 11:52
  4. keypress while editing an item in QListWidget
    By Beluvius in forum Qt Programming
    Replies: 3
    Last Post: 4th April 2006, 09:56
  5. QListWidget add QListWidgetItem
    By fellobo in forum Qt Programming
    Replies: 3
    Last Post: 20th February 2006, 19:37

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.