Listview viewing order
-
@ThMars
Since the model is in a separate file/component, create another instance of it, which of course will have the initial order -
I do not want the original order to save but read / get from the listview the order that is established after the items have been dragged to their new positions in the view. My model is derived from an array and I have to change the order of the array conform the view.
-
@ThMars
k, my fault.
Oddly I think there is no convenient way. A Workaround could be to make the index part of the model data (in the ListModel), then access it this way:
The example uses a proxy model (DelegateModel), which provides a items property of the DelegateModelGroup, which provides a get() method.
And returns a JS object with a object with certain properties:
https://doc.qt.io/qt-5/qml-qtqml-models-delegatemodelgroup.html#get-method -
@ThMars
then check the itemsIndex property of the returned object