Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-127863

DragHandler Activates When Dragging Starts Outside the Item and Moves Inside

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.8
    • Quick: Other
    • None

    Description

      If dragging starts from outside an item that includes a DragHandler, the item's DragHandler will be activated when the cursor moves over the item.

      Steps to Reproduce:

      • Run the snippet
      • Start dragging from outside the red rectangle
      • Move the cursor over the rectangle
      • Then try to move it outside again
      • Drop it

      EXPECTED:

      The rectangle's DragHandler should not be activated since dragging started from outside the rectangle

      ACTUAL

      • The rectangle's DragHandler is activated as long as the cursor is inside the rectangle.
      • The red rectangle moves with the cursor (in case of commenting target: null)

       

       

      import QtQuick
      import QtQuick.Window
      import QtQuick.Controls
       
      ApplicationWindow {
          id: root
          width: 500
          height: 500
          visible: true
       
          Rectangle {
              x: 200
              y: 200
              width: 100
              height: 100
              color: "red"
              DragHandler {
                  onActiveChanged: print("active:", active)
                  // target: null
              }
          }
      }
      

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            srutledg Shawn Rutledge
            mhqanbari MohammadHossein Qanbari
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes