DelegateModel && QAbstractListModel, move element



  • Hi all,
    I have a C++ QAbstractListModel exposed to QML.
    My QML list looks like the following:

    ListView {
            id: mainListView
            model: DelegateModel {
                id: visualModel
                model: imageModel
                delegate: MainListDelegate {
                }
            }
    }
    

    where imageModel is my QAbstractListModel.
    For my MainListDelegate I followed the example in

    Examples/Qt-5.5/quick/draganddrop/
    

    to move element by drag and drop and it works.

    Now the problem is how to "reflect" the new sorting of the element in the main QAbstractListModel to be used in C++ space.

    Is there a way?

    Thanks


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.