[Interest] Model/View issue: omit model-entities in qml-view

Tim Bienias tim.bienias at googlemail.com
Mon Oct 29 17:19:28 CET 2012


That's exactly what i want! thx very much!

2012/10/29 André Somers <andre at familiesomers.nl>

> Op 29-10-2012 17:12, Tim Bienias schreef:
> > Hey guys,
> >
> > let's say we have one QAbstractListModel consisting of animals in c++.
> > There are water- and land-animals within the model. Now i want to
> > create a view that does show (1)only the land-animals and a view with
> > (2)only the water-animals. There is also a view (3)with some water-
> > and some land-animals.
> > The views are made with QML/Quick2.
> > How can I achieve this? Is it possible to access just some animals of
> > the model and show them, or does a view (ListView or whatever) show
> > all animals from the model?
> > Otherwise i have to create 2 models - one consisting of water-animals
> > and one of land-animals, but that's not what i want and it still
> > would'nt solve (3).
> > Please give me a little hint or link.
> >
> > cheers,
> > tim
> Proxy models are the key. Start with considdering QSortFilterProxyModel.
>
> André
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20121029/4a6abe29/attachment.html>


More information about the Interest mailing list