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. Two ListViews: drag from one to another

Two ListViews: drag from one to another

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 205 Views 1 Watching
  • 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.
  • T Offline
    T Offline
    themts
    wrote on last edited by
    #1

    Hey guys,

    I have two listviews. One ListView has several items which I want to drop into another ListView (TargetList).
    When I drag into the TargetList I want the other items move away (indicate the drop position). After drop I don't want to remove the item from the source-list.

    Here is what I did:
    I've created an additional delegate item which is invisible.
    When I start dragging I move it over the underlying delegate on the sourceList and make it visible.
    I placed a DropArea in my TargetList, so I can drop it there.
    So far so good.

    As long as the list is empty everything is fine. When there is already an item in the TargetList I want to move it a little bit away to indicate the drop-position.
    Therefor I placed a DropArea inside my target delegate. Unfortunately this DropArea doesn't receive any events as the ListView DropArea is on top of it.

    First of all: Is this the right approach or would you recommend something different?
    If I'm on the right path, how can I forward the mouse-events through the overlaying dropArea to the underlying dropArea?

    Best regards
    mts

    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