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. How do I identify Drag & Drop sources across multiple QtQuick ListView controls.
QtWS25 Last Chance

How do I identify Drag & Drop sources across multiple QtQuick ListView controls.

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 199 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.
  • J Offline
    J Offline
    JuanBucz
    wrote on last edited by JuanBucz
    #1

    Hi:

    I'm doing some prototyping use QtQuick ListViews.
    I have 3 lists defined and am implementing Drag and Drop between those lists.
    There are some "rules" I would like to implement.

    1. Item from List1 can be dropped onto List 2 and List3

    2. Item from List2 can be dropped onto List3, but not List1

    3. When an item is an item is dropped onto List3, I would like to be identify the source and
      update the associated ListModel

    4. An Item from List can be dropped onto itself and the result should put the item into a different position with the list.

    5. When an item is hovering over a destination, I would like to have a visual indicator differentiating between an allowable/disallowable destination..

    Currently I have this small QML code snippet that handles 1 way Drag&Drop between 2 ListViews:

    DropArea {
               id: dropArea1
               anchors.fill: parent
               onDropped: {
                    var item = listView.model.get(listView.dragItemIndex);
                     listView1.model.insert(0, item)
                     listView.model.remove(listView.dragItemIndex);
                     listView.dragItemIndex = -1;
                }
    }
    

    I would like to be able to handle this functionality through QML.
    Can someone help me with answers for these questions?

    Thanks,
    JohnB

    1 Reply Last reply
    1

    • Login

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