Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

drag && dropArea BUG



  • //drag file
    Drag.keys: [ "InterfaceLink" ]
    Drag.active: mouseArea.drag.active
    Drag.hotSpot.x: width/2
    Drag.hotSpot.y: height/2
    Drag.source: root

    //drop file
    import QtQuick 2.12

    DropArea {
    id: root

    onEntered: {
        console.log("input enter",drag.source.objectName)
    }
    
    onContainsDragChanged: {
        console.log("containsDrag ",containsDrag)
    }
    
    onExited: {
        console.log("input exit",drag.source.objectName)
    }
    
    onDropped: {
        console.log("input drop",drop.source.objectName)
    }
    

    }

    when drag enter droparea, then emit onEnter is ok!, after release mouse, then the dropArea print exit && containsDrag==false, why????????????



  • try Qt 5.13 / 5.14 dropArea works fine for me.
    Your complaint is that it does not say input drop?
    Maybe drag.source.objectName is not valid? try removing that
    Because on mouse release contains drag will be false as the drag stopped (dropped)


Log in to reply