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

DragHandler will be always activated if gesture started outside its area

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.0
    • 5.13.0, 5.15.2
    • None
    • Dell XPS 15 9560, Windows 10
    • Windows

    Description

      Example code:

      import QtQuick 2.13
      import QtQuick.Controls 2.13
      
      ApplicationWindow {
          visible: true
          width: 640
          height: 480
      
          Rectangle {
              y: 150
              width: 50
              height: 50
              color: "blue"
      
              TapHandler {
                  grabPermissions: PointerHandler.TakeOverForbidden
              }
          }
      
          Rectangle {
              id: rectangle
      
              x: 100
              y: 100
              width: 200
              height: 200
              color: dragHandler.active ? "red" : "orange"
              opacity: 0.8
      
              DragHandler {
                  id: dragHandler
                  grabPermissions: PointerHandler.TakeOverForbidden
              }
          }
      }
      

      Steps to reproduce of the problems:

      • Press and hold mouse on the blue rectangle and drag in the direction of orange rectangle

      or:

      • Press and hold mouse outside of the blue or orange rectangles and drag in the direction of orange rectangle

      Results: 

      It is not possible to prevent grab of the event in the DragHandler if the event started outside the area of the orange rectangle. This type of DragHandler behavior can lead to side effects and unwanted activation of some DragHandler, so it would be good to have some mechanism to control this behavior if it is not desired. Aside from this problem, the orange rectangle jumps unsightly when dragging begins (see: https://bugreports.qt.io/browse/QTBUG-77638)

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            permotion88 Karol Polak
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes