Results 1 to 4 of 4

Thread: How to optemize QTableWidget?

  1. #1
    Join Date
    Feb 2008
    Posts
    154
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default How to optemize QTableWidget?

    Hi,
    I have a problem now ,I have a QTableWidget with 6 columns and more than 100628 row. It means (6 * 100628) of QTableWidgetItem. so when i fill the table the following two problems are arising :-
    1- the application takes 1 minute approximately to fill the table(which is a long time for me).
    2- the application takes a huge memory in the RAM.

    so i thought that i should only display a limited number of rows and when the user scroll down, another rows are displayed.
    is that possible ? how?
    is there any better way to do this?
    thank you

  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: How to optemize QTableWidget?

    Quote Originally Posted by mismael85 View Post
    is there any better way to do this?
    Yes, use QTableView with a model.
    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
    Feb 2008
    Posts
    154
    Thanks
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to optemize QTableWidget?

    but i think that QTableView also loads all the items at startup. and also loads all of them in the memory.
    or it just loads the displayed items?

  4. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: How to optemize QTableWidget?

    Quote Originally Posted by mismael85 View Post
    but i think that QTableView also loads all the items at startup. and also loads all of them in the memory.
    or it just loads the displayed items?
    That depends on the model.
    See the canFetchMore() and fetchMore() functions.

Similar Threads

  1. QTableWidget
    By deeee in forum Qt Programming
    Replies: 6
    Last Post: 26th May 2010, 18:31
  2. Help with QTableWidget
    By aarelovich in forum Qt Programming
    Replies: 4
    Last Post: 20th July 2009, 12:22
  3. QTableWidget
    By abrou in forum Newbie
    Replies: 3
    Last Post: 25th July 2008, 19:09
  4. QTableWidget
    By dragon in forum Qt Programming
    Replies: 14
    Last Post: 18th April 2007, 19:15
  5. QTableWidget
    By alexx in forum Qt Programming
    Replies: 1
    Last Post: 4th February 2007, 22:00

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.