Results 1 to 6 of 6

Thread: QListWidget / QListView Bug ?

  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

    Wink QListWidget / QListView Bug ?

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

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QListWidget / QListView Bug ?

    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.

  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 / QListView Bug ?

    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

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QListWidget / QListView Bug ?

    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.

  5. #5
    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 / QListView Bug ?

    Thanks for replying Wysota, I'll try this!

  6. #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 / QListView Bug ?

    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
    Guilugi.

Similar Threads

  1. QListView & backgroundBrush -> Houston we hv a problem
    By travis in forum Qt Programming
    Replies: 3
    Last Post: 31st July 2006, 07:13
  2. keypress while editing an item in QListWidget
    By Beluvius in forum Qt Programming
    Replies: 3
    Last Post: 4th April 2006, 09:56
  3. QListWidget add QListWidgetItem
    By fellobo in forum Qt Programming
    Replies: 3
    Last Post: 20th February 2006, 19:37
  4. QListView
    By dragon in forum Newbie
    Replies: 1
    Last Post: 25th January 2006, 21:08
  5. Keeping focus at bottom of QListView
    By jakamph in forum Qt Programming
    Replies: 4
    Last Post: 10th January 2006, 14:45

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.