Hello,

You could use the nested model pattern : for example, QxOrm library
provides an implementation of this pattern in the QxModelView module :
http://www.qxorm.com/doxygen/html/group___qx_model_view.html
QxEntityEditor application can generate the model source code to manage
database relationships as nested models : so you can work easily with these
models in QML views !

Here is a french tutorial about nested model concept :
http://christophe-dumez.developpez.com/tutoriels/qt/qml/exposer-modeles-imbriques/
The original english tutorial link doesn't work anymore.

2015-03-23 22:52 GMT+01:00 Gunnar Roth <gunnar.r...@gmx.de>:

> Why not use a list view with sections? see
> http://doc.qt.io/qt-5/qml-qtquick-listview.html#section-prop
>
>
> Am 23.03.2015 um 22:48 schrieb Jason H <jh...@gmx.com>:
>
> In a flickable, I want to have a 2-layer hierarchy:
> Category 1
>  Item 1
>  Item 2
> Category 2
>  Item 1
>  Item 2
> ...
> Category N
>  Item X
>  Item Y
>  Item Z
>
>
> How can I create QML element that allows any number of Categories and
> Items? Can I use one root model?
> Or must I create these categories dynamically using createComponent? I'd
> rather not use createComponent.
>
> Thanks.
>
>
> _______________________________________________
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
>
> _______________________________________________
> Interest mailing list
> Interest@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to