Subject: why do we have a root item for DiveItem

Amit Chaudhuri amit.k.chaudhuri at gmail.com
Thu Apr 25 12:20:31 PDT 2013


Dirk,

A root item is required for the model's hierarchy.  Each item in a model
(derived from QAbstractItemModel) can be uniquely specified by a
combination of row, column and parent params.  In this case, the root item
is the parent of all top level items in the tree.

Lists and Tables don't need the parent parameter in the same way that Trees
do.  This will matter a bit more when we add support for Trips.  Then we
will have the possibility that a Dive might have a Trip (rather than the
invisible rootItem) as parent.  Whether we need the default ctor for this
is not 100% clear to me.  We might be able to use the other one and specify
suitable values to that.  Possibly a question for one of the others, or I
need to play or research some detail.

A
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130425/fb1e5b8d/attachment.html>


More information about the subsurface mailing list