Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. DelegateModel && QAbstractListModel, move element
Qt 6.11 is out! See what's new in the release blog

DelegateModel && QAbstractListModel, move element

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 627 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    luca
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved