-1

I have a listview with groupdatamodel, i need to insert the list data at end of the groupdatamodel, Here i have pasted the code what i have done

                    GroupDataModel {
                        id: grouplistdatamodel
                    },
                    DataSource {
                        id: dataSource
                        source: "http://myurl.com"
                        onDataLoaded: {
                              grouplistdatamodel.insertList(data); //it will insert the data at first position in listview but i need to insert the data at last position
                         }
                    }

Can anyone help me about this regards,

SelvaRaman
  • 218
  • 2
  • 15

2 Answers2

0

In GroupDataModel should not be able to insert the data at specific poisition, so i have changed the ArrayDataModel instead of GroupDataModel.

SelvaRaman
  • 218
  • 2
  • 15
0


I'm thinking of two ways to achieve this.
First, you can try to play with the GroupDataModel method setSortedAscending(bool ascending).
Otherwise, you could use setSortingKeys(const QStringList &keys) and add to the data you put in the GroupDataModel a specific key used only to sort the list.

nicolas
  • 234
  • 4
  • 11