Hello,
I have a QTableWidget which owns 640*480 QTableWidgetItems.
When I make a clearContents() on it, it takes several seconds to do it. Is there any way to empty the table faster?
Thank you.
Hello,
I have a QTableWidget which owns 640*480 QTableWidgetItems.
When I make a clearContents() on it, it takes several seconds to do it. Is there any way to empty the table faster?
Thank you.
640*480 are 307200 items! You really should consider using a model. And there is no faster way, only create a new table widget and remove the items in background.
punkypogo (5th August 2010)
I know this is really huge. Do you think using a model will increase performance?
Well, a QStandardItemModel surely not, but if use e.g. a SQL** model (or a custom one) then yes, because no items (=disk memory) need to be removed etc. Just set up a database with 30.000.000 items and display them using a QSqlTableModel and see how fast it is "cleared".
I just implemented with QAbstractTableModel, and wow! This is incredibly fast compared to QTableWidget!
Thanks a lot for your answer!
Cheers.
Bookmarks