Results 1 to 5 of 5

Thread: qListWidget nad update problem

  1. #1
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default qListWidget nad update problem

    Hello,
    I'm having problem with "repainting" qListWidget. By "repainting" I mean updating and relayouting items inside, the same as it happens when I additem to list.
    How can I "manually" update listWidget?

    Any suggestion are more then welcome
    Bets regards

    EDIT. Sorry for commotion, right after posting I found answer by accident, so to sums it up using doItemsLayout do the trick.
    Last edited by Talei; 2nd April 2010 at 08:52.

  2. #2
    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 nad update problem

    Call update() on the widget.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: qListWidget nad update problem

    I did that at the beginning, but nothing happens.
    I use qListWidget and populate it with QListWidgetItem and I want to rearrange items (scaled Images displayed as QIcons, I know that I should use delegates but I want to keep it as simple as possible) on window resize.

  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 nad update problem

    Quote Originally Posted by Talei View Post
    I did that at the beginning, but nothing happens.
    What would you expect to happen?

    I use qListWidget and populate it with QListWidgetItem and I want to rearrange items (scaled Images displayed as QIcons, I know that I should use delegates but I want to keep it as simple as possible) on window resize.
    Please define "rearrange". How exactly do you do that in your code?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: qListWidget nad update problem

    After importing images and scaling them, items ( items == images + description) are arranged depending on the widget size, i.e. when widget width is smaller then (2x item width + spacing) they arrange in one column but when I resize window (previous statement is true ) then I want them to rearrange into two (or more depending on the widget size ) columns. And calling doItemsLayout () do the trick.
    Sorry for confusion, it's probably due to my poor eng, or not properly stated question.
    Best regards

    EDIT: also listWidget->setResizeMode( QListView::Adjust ); do the trick ... seriously I need some sleep.
    Last edited by Talei; 2nd April 2010 at 10:22.

Similar Threads

  1. Problem with canvas()->update()
    By jblovloss in forum Qwt
    Replies: 1
    Last Post: 25th August 2009, 14:28
  2. QListWidget update
    By Elwe in forum Qt Programming
    Replies: 1
    Last Post: 18th June 2009, 09:18
  3. QSlider Update Problem
    By December in forum Qt Programming
    Replies: 4
    Last Post: 10th September 2006, 04:02
  4. View update problem
    By prakash in forum Qt Programming
    Replies: 6
    Last Post: 17th March 2006, 10:13
  5. Problem with screen update...
    By mysearch05 in forum Qt Programming
    Replies: 2
    Last Post: 27th January 2006, 18:24

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.