I use QTableWidget to display some dataset. If there are 10000 or more rows, it takes about 10 seconds. Is there anyway to speed up ? Thanks a lot.
I use QTableWidget to display some dataset. If there are 10000 or more rows, it takes about 10 seconds. Is there anyway to speed up ? Thanks a lot.
From my experience in Clarion all browse boxes were dynamically loaded in per-page fashion. Try to load only so much records that will fit in browse widget. (For example, if you have 10000000 records in file and your browse widget is capable of showing 50 records per page, load them only 50). I know this is a lot of work to do because you must then rewrite scroll bar handling methods, which is not simple at all.
Qt 5.3 Opensource & Creator 3.1.2
QTableWidget is not designed as efficiency but as convenience in mind. You should consider switching to real model-view approach to have some efficiency.![]()
J-P Nurmi
He means QTableView. It is model based, while QTableWidget is item based.
There is a huge difference for example while adding items. With QTableView + model you can optimize it so that all the 10000 items gets added at time and then the view is updated once. On the other hand, adding 10000 items to a QTableWidget causes a lot of interaction under the hood, between the hidden built-in model and the view. It's just that QTableWidget has to be bulletproof and to work in every possible situation which also makes it slow, unfortunately.
J-P Nurmi
Bookmarks