[Kde-pim] Akonadi::CollectionView wrapping model

Till Adam till at kdab.net
Sun Mar 2 12:12:33 GMT 2008


On Sunday 02 March 2008 12:08:56 Volker Krause wrote:
> On Saturday 01 March 2008 22:42:07 Kevin Krammer wrote:
> > Till and I just debugged a problem I had with a weird CollectionModel
> > behavior.
> > It turned out that the model was working correctly, but that it wasn't
> > actually the model used by the view because CollectionView::setModel
> > "wraps" it, i.e.  uses it as a source model for an internal one.
> >
> > Basically
> > view->setModel( myModel );
> > model = view->model();
> >
> > model != myModel
> >
> > Not what I had expected.
> > Anything we can do about this?
>
> I think this is only used to get built in sorting in the view, so we can
> problem remove that. Originally it was needed for a lot more IIRC, mostly
> because my total misuse of the model/view stuff, the collection model/view
> was my first interview experiment. Most of this probably has been cleaned
> up by now, but if you still find strange stuff in there, that's why ;-)

The reason why I recognised this is a potential culprit pretty quickly is
that I've made the same mistake a few times in my first couple of
attempts at doing model/view. ;) It's a subtle trap, but one folks seem
to run into quite a bit.

Cheers,

Till

-- 
Till Adam
KDAB - platform independent software services
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list