Results 1 to 5 of 5

Thread: QTableWidget optimize

  1. #1
    Join Date
    May 2013
    Posts
    45
    Thanks
    11
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default QTableWidget optimize

    Hi.
    I have in my application around 6 QTableWidget, where are more than 1000 rows in each table. but when i add new row or recreate table, is it too slow. is possible optimize QTableWidget?

    sorting is enabled.
    i used insertRow() and setItem() for adding new row
    Last edited by stevocz; 11th November 2014 at 10:36.

  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: QTableWidget optimize

    You can possibly get it faster by replacing QTableWidget with QTableView and implementing a proper model for it.
    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
    May 2013
    Posts
    45
    Thanks
    11
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: QTableWidget optimize

    and without QTableView ?

  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: QTableWidget optimize

    Depends what you do with QTableWidget. But in general it is meant to be a convenience replacement for QTableView in simple situations. As the flow gets complex, users should switch to QTableView.
    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 2006
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableWidget optimize

    You may want to try turning off sorting before inserting/creating.
    Then turn sorting back on after inserts/creates are finished.

Similar Threads

  1. how to optimize QSqlQuery?
    By karankumar1609 in forum Qt Programming
    Replies: 10
    Last Post: 10th April 2014, 11:59
  2. QStringList optimize code block
    By pdoria in forum Qt Programming
    Replies: 1
    Last Post: 27th March 2012, 06:28
  3. Optimize QGraphicsItem update
    By paolom in forum Qt Programming
    Replies: 10
    Last Post: 21st March 2011, 15:29
  4. How to optimize qt libs for embedded x86?
    By yangyunzhao in forum Installation and Deployment
    Replies: 2
    Last Post: 30th June 2009, 09:47
  5. Optimize Qt Library
    By Svaths in forum Qt for Embedded and Mobile
    Replies: 11
    Last Post: 15th July 2007, 22:25

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.