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 to use Drag.Automatic

How to use Drag.Automatic

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

    Hi Guys,

    Just updated to 5.2 and eager to test external drag and drop but want to better understand Drag.Automatic. Right now I have this code sample:

    @Item {
    id: draggable
    width : 50;
    height : 50;

        Drag.active: mouseArea.drag.active
    
        Drag.mimeData: { "text/plain": "test" }
        //Drag.dragType: Drag.Automatic
    
        Rectangle {
            anchors.fill: parent
            color : "red"
        }
    
        MouseArea {
            id: mouseArea
            drag.target: draggable
            anchors.fill: parent
        }
    }@
    

    It works as expected, I can drag a red rectangle around. But if I un-comment

    @Drag.dragType: Drag.Automatic@

    now the rectangle does not move during the drag and will only change its position when I release the mouse.

    Do I need to do something else to make it move during the drag and not only when I drop?

    Thanks a lot!

    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