Results 1 to 2 of 2

Thread: QListWidget update

  1. #1
    Join Date
    Jun 2009
    Location
    Switzerland
    Posts
    9
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy QListWidget update

    Hi guy! I'm here again with a new problem!

    I search, and search, and search... So let me explain. I've a QListWidget, but when a resize items, they are the one on the other. They adjust only when I'm move by a drag&drop.

    I've try to use update and repaint, but without any success! Someone could help me?

    Qt Code:
    1. for (int i = 0; i < widgetList->count(); i++) {
    2. if (groupeListWidget.at(i)->count() != 0
    3. && groupeListWidget.at(i)->count() != 1) {
    4. widgetList->item(i)->setSizeHint(QSize(
    5. widgetList->sizeHintForColumn(0), (26*
    6. groupeListWidget .at(i)->count()) + 54));
    7. widgetList->itemWidget(widgetList->item(i))->adjustSize();
    8. }
    9. widgetList->update(); //or repaint()
    10. }
    To copy to clipboard, switch view to plain text mode 

    The items are those of the widgetList

    PS: My QListWidget contains another QListWidget, but it doesn't matter, I think.

  2. #2
    Join Date
    Jun 2009
    Location
    Switzerland
    Posts
    9
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QListWidget update

    I've found the answer. To do this, I finally use the function called doItemsLayout.

    But I don't find this function in the trolltech documentation...

Similar Threads

  1. Problem in QProgressBar update
    By nikhilqt in forum Qt Programming
    Replies: 0
    Last Post: 10th March 2009, 10:20
  2. QListWidget transparent background or pixmap
    By wdezell in forum Qt Programming
    Replies: 6
    Last Post: 6th March 2009, 17:53
  3. Qt Update project - Opinions wanted
    By pvdk in forum Qt Programming
    Replies: 0
    Last Post: 8th November 2008, 08:41
  4. QPainter update()
    By csvivek in forum Qt Programming
    Replies: 5
    Last Post: 24th March 2008, 09:42
  5. Replies: 13
    Last Post: 15th December 2006, 11:52

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.