[Interest] Proper way of updating a model?
apaku at gmx.de
Thu Aug 23 00:17:11 CEST 2012
On Wed, Aug 22, 2012 at 8:53 PM, Jason H <scorp1us at yahoo.com> wrote:
> I'd probably be using something like libQxt's RPC's functionality to publish
> updates to you and incrementally adjust the model, a row at a time.
Doing changes in the itemviews a row or cell at a time with many
rows/cells is a really bad idea, especially if cells are added/removed
or if the data inside the cells somehow cause relayouting (column
width needs to be adjusted, cells grow due to content growth etc.).
Relayouting is an expensive operation and hence should be done as
rarely as possible. Its usually much better to queue individual
changes coming from a fast-supplying data source and telling the
framework about the changes in batches. The batchsize varies on how
complex the tree and data is, but I'd usually start with 20 rows at
once and then see if that is ok, otherwise increase (or decrease if
the data needs to be updated more often).
More information about the Interest