Results 1 to 7 of 7

Thread: Using QProgressBar

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    4
    Thanked 140 Times in 132 Posts

    Default Re: Using QProgressBar

    Quote Originally Posted by gutiory View Post
    I can't do what you've said, because the long operation comes from a GUI operation. I've a QTableView and I asign it a model that contains one hundred columns and fifteen rows. The asignment of the model to the view makes the app slow.
    okay, so it means your model is containing a lot of data, so I would suggest you making your own model which would do some lazy/delayed data loading:
    1. You set your model to a view when it is still empty, so as fast as light :]
    2. Now fire some method in model - let's call it load() - to load the data, lets say row by row, the loading is done in separate thread.
    3. Your view can be updated on each row added (rowsInserted() and something like this).
    4. The progress bar can be displayed until loading is finished.

    This probably will take longer then just setting model like you have done it now, but will not freeze your GUI.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  2. #2
    Join Date
    Oct 2009
    Posts
    28
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    4
    Thanked 2 Times in 2 Posts

    Default Re: Using QProgressBar

    Problem solved guys.
    Thanks a lot for your answer. You were completly right. The solution is creating a method that partially load data. The behavior of the app is the same I thought, but every content appears inmediatly.
    I've learnt so many things because of this problem.

    Thanks a lot again and sorry for answering so late.

    Regards.

Similar Threads

  1. update the QProgressBar
    By aloha in forum Newbie
    Replies: 16
    Last Post: 23rd April 2009, 21:07
  2. Use of QProgressBar in Thread
    By merry in forum Qt Programming
    Replies: 2
    Last Post: 5th January 2009, 22:53
  3. QProgressBar in QTreeWidget?
    By lvi in forum Qt Programming
    Replies: 5
    Last Post: 3rd September 2008, 20:48
  4. QProgressBar + Mac OS X
    By THRESHE in forum Qt Programming
    Replies: 5
    Last Post: 14th December 2007, 14:41
  5. QProgressBar & 200%
    By Dmitry in forum Qt Programming
    Replies: 2
    Last Post: 20th January 2006, 12:33

Tags for this Thread

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.