[PATCH] Remove useless members of DiveItem
Thiago Macieira
thiago at macieira.org
Thu Apr 25 15:14:22 PDT 2013
On quinta-feira, 25 de abril de 2013 08.50.16, Linus Torvalds wrote:
> On Thu, Apr 25, 2013 at 8:46 AM, Thiago Macieira <thiago at macieira.org>
wrote:
> > Right. The model needs to be told anyway because the model will need to
> > tell the view (the UI) that something changed. If the dives could change
> > without notifying the UI, it could keep on happily displaying old data
> > and then lead to weird conditions later on.
>
> As long as Qt won't continue to use the data, I guess that's fine. The
> thing that worried me was things like queued updates in the event
> structures etc. The main loop of GUI stuff tends to have various
> queued stuff, but if it's safe to delete view elements at any time,
> then that's fine.
The model needs to tell that it's changing.
rowsAboutToBeInserted
rowsAboutToBeMoved
rowsAboutToBeRemoved
i.e., "prepare yourself", followed by
rowsInserted
rowsMoved
rowsRemoved
"now you can display again"
If the data changes completely and you lost track, there's always
modelAboutToBeReset + modelReset
I'm guessing here, but I'd suppose the more specific ones allow for a faster
re-display and will also try and keep the user selection, scrolling position,
etc.. The model reset is a big hammer.
http://qt-project.org/doc/qt-4.8/qabstractitemmodel.html#signals
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130425/969a229f/attachment.sig>
More information about the subsurface
mailing list