[Interest] Design Issue with QAbstractItemModel & QTreeView

Bernhard Lindner private at bernhard-lindner.de
Thu Aug 4 22:20:29 CEST 2016


I have seen that problem before:

http://stackoverflow.com/q/36412671/1421332

Unfortunately no answer there too.

> I'm not sure what are you talking about. But what about
> beginInsertRows() and endInsertRows()? Between this methods you should
> add new data, and this data can has child rows.
> 
> What is the problem?
> 
> On 04.08.2016 19:48, Sébastien Le Ray wrote:
> > Hi list,
> > 
> > I'm currently designing an application which presents its data in a
> > tree. I have a QAbstractItemModel making a bridge between these data
> > and the view, so far so good.
> > 
> > However I'm stuck when it comes to react to underlying data structure
> > changes, specifically when rows are added and removed. Model has to
> > react before and after the row is added, however, the only information
> > it gets is "row added" signal. Worse, adding a row can add the row and
> > some subitems (some objects creates mandatory children).
> > 
> > What is the proper way to deal with this? Should I have some kind of
> > proxy between the data and the mode?
> > 
> > Regards

-- 
Regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160804/58b0a4c8/attachment.sig>


More information about the Interest mailing list