[Qt-interest] Slow QTreeWidget
Kenneth Beck
nekkceb at comcast.net
Wed Mar 25 14:14:15 CET 2009
RZ wrote:
> In my case I had a model and a view (maybe you could do that too) and
> the setUpdatesEnabled didn't help that much - so I added two more lines:
>
> model->blockSignals(true);
> setUpdatesEnabled(false);
> bigVisualChanges(); // loop with your addResultRow call
> setUpdatesEnabled(true);
> model->blockSignals(false);
>
> The effect was more than significant .....
Thanks to both for the suggestions.
setUpdatesEnabled(false) did not do much, except to delay the visual
update until the end. I have a progress bar that steps with each row
add, and the time between steps gets progressively slower as rows get
added, again as if it is looping back to somehow update all the previous
data with each call to setText.
This is currently NOT a model/view, it was a pretty simple display of
data. I will try the model/view approach.
Just a further comment -- this is REALLY slow -- I only have 14 rows,
and close to 50 columns, and it takes 2-3 minutes to populate the table.
Surely there must be some way to improve performance here. You would
think that a set text on a given row would not have to involve the other
rows in a TableWidget or TreeWidget.
More information about the Qt-interest-old
mailing list