The speed is greatly reduced when you spray a lot of data on QTableWidget. Help!
-
The qt version is 4.8.7
OS is Centos7.I attempted to insert more than 100,000 integer data into QTableWidget. However, UI was not allowed because the rate at which data was filled in the cell was greatly reduced.
It is currently designed to fill data with a double repeat statement(for).
Help me with any ideas! -
May be your application is single threaded. Since you are inserting large set of data, UI is not able to refresh. May be you can insert rows (30 or so) in batches. Where are you fetching the data ? Are you doing the fetch & insert at same time ? If yes, see if you can split the fetch & insert into UI, make it concurrently.
-
May be your application is single threaded. Since you are inserting large set of data, UI is not able to refresh. May be you can insert rows (30 or so) in batches. Where are you fetching the data ? Are you doing the fetch & insert at same time ? If yes, see if you can split the fetch & insert into UI, make it concurrently.
There are four different QTableWidgets and four different integer vectors (element: 100,000).
One integer vector per table (element: 100,000) is inserted in turn.
When we experimented, it took too long to insert one integer vector (element: 100,000) into a single table.
The integer vector is pre-created before filling the table.
After the integer vector is finished, it begins to fill the table.
-
There are four different QTableWidgets and four different integer vectors (element: 100,000).
One integer vector per table (element: 100,000) is inserted in turn.
When we experimented, it took too long to insert one integer vector (element: 100,000) into a single table.
The integer vector is pre-created before filling the table.
After the integer vector is finished, it begins to fill the table.
@keyboard_hellchang you should use a proper model for your view and implement
canFetchMore and fetchMore for dynamic loading of the data, your view will not need to display 100000 items at oncetake this example from the documentation as a guide
https://doc.qt.io/qt-5/qtwidgets-itemviews-fetchmore-example.html -
The qt version is 4.8.7
OS is Centos7.I attempted to insert more than 100,000 integer data into QTableWidget. However, UI was not allowed because the rate at which data was filled in the cell was greatly reduced.
It is currently designed to fill data with a double repeat statement(for).
Help me with any ideas!@keyboard_hellchang said in The speed is greatly reduced when you spray a lot of data on QTableWidget. Help!:
I attempted to insert more than 100,000 integer data into QTableWidget.
Maybe this is not a suitable number of items for a generic
QTableWidget
?! If I assume you have, say, 20 columns, that would be 5,000 rows. That's an awful lot for a user to look/scroll through!As @J-Hilk has said, use a proper model for this much data, and do some dynamic fetching/paging when the user needs to scroll.
-
May be your application is single threaded. Since you are inserting large set of data, UI is not able to refresh. May be you can insert rows (30 or so) in batches. Where are you fetching the data ? Are you doing the fetch & insert at same time ? If yes, see if you can split the fetch & insert into UI, make it concurrently.
@dheerendra
QAbstractTableModel has been used to solve this problem! Thank you! -
@keyboard_hellchang you should use a proper model for your view and implement
canFetchMore and fetchMore for dynamic loading of the data, your view will not need to display 100000 items at oncetake this example from the documentation as a guide
https://doc.qt.io/qt-5/qtwidgets-itemviews-fetchmore-example.html@J-Hilk
QAbstractTableModel has been used to solve this problem! Thank you! -
@keyboard_hellchang said in The speed is greatly reduced when you spray a lot of data on QTableWidget. Help!:
I attempted to insert more than 100,000 integer data into QTableWidget.
Maybe this is not a suitable number of items for a generic
QTableWidget
?! If I assume you have, say, 20 columns, that would be 5,000 rows. That's an awful lot for a user to look/scroll through!As @J-Hilk has said, use a proper model for this much data, and do some dynamic fetching/paging when the user needs to scroll.
@JonB
QAbstractTableModel has been used to solve this problem! Thank you!