[Interest] ListModels with sections, not grouping by section

Keith Gardner kreios4004 at gmail.com
Thu Mar 26 17:35:17 CET 2015


On Thu, Mar 26, 2015 at 11:30 AM Jason H <jhihn at gmx.com> wrote:

> So I'm trying to use sections, and it seems that the data must be
> explicit  ordered by section otherwise you get the section repeated
> whenever it changes that is to say:
> [
>   { 'a':'A' 'b':'1'}
>   { 'a':'B' 'b':'2'}
>   { 'a':'C' 'b':'1'}
> ]
> section by 'b', we get three groups:
> 1
> + A
> 2
> + B
> 1
> + C
>
> Whereas I expected:
> 1
> + A
> + C
> 2
> + B
>
> Is there some property I need to set or something?
>

In the documentation for ListView's section property (
http://doc.qt.io/qt-5/qml-qtquick-listview.html#section-prop), it states
that it will not reorder the data.  This would be found at the "Note"
portion.  You need to sort your data.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150326/e03461db/attachment.html>


More information about the Interest mailing list