Results 1 to 7 of 7

Thread: QListWidget::addItem and display immediately

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2007
    Posts
    7
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QListWidget::addItem and display immediately

    First of all thanks for the quick answer.

    The main reasons why it takes so long to insert items are some operations that take place in background. The listview must keep user informed with the progress, so the problem is not to optimize insertion of items, but to update the listbox immediately.

    The only problem i have is that QThread needs a run() and this makes my design more odd... The question is if i can avoid QThread ...

    Thanks

  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::addItem and display immediately

    One way would be to call QCoreApplication::processEvents() every once in a while to let the application process its events. This will make the overall process a bit longer, though:
    Qt Code:
    1. // a busy loop
    2. for (...)
    3. {
    4. // do something
    5.  
    6. // let the application process its events
    7. QCoreApplication::processEvents();
    8. }
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

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

    vlg789 (24th September 2007)

  4. #3
    Join Date
    Sep 2007
    Posts
    7
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up Re: QListWidget::addItem and display immediately

    Thanks man,
    this is what i was looking for.

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
  •  
Qt is a trademark of The Qt Company.