[Qt-interest] begin/endInsertRows and underlying data structures

Arnold Krille arnold at arnoldarts.de
Sun May 10 09:11:39 CEST 2009


On Sunday 10 May 2009 01:53:26 Emil Eriksson wrote:
> In its current form, QAbstractItemModel requires beginInsertRows and
> endInsertRows to be called before and after inserting rows. Insertion
> and removal operations for rows and columns  This is all fine in some
> cases, but it's not always that the underlying data structure can
> notify the model BEFORE changes.

The views don't need to get signaled before the underlying data is changed. It 
just wants to be notified before it can access that new data via the model...

And for big changes you can always use reset.

I think the model-view-concept is quite good actually, for some things you 
just have to get used to it and get your head around it. Only the views could 
get enhancement in that the abstract view should either not be qobject or 
multiple inheritance of qobject should be made possible somehow. Because now 
you can't create views that aren't gui. And you can create views that are for 
example direct graphicsviews.

Have fun,

Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090510/57a117af/attachment.bin 


More information about the Qt-interest-old mailing list