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

DragHandler in a Controls 2 Button: can't click the button

    XMLWordPrintable

Details

    Description

      import QtQuick 2.0
      import Qt.labs.handlers 1.0
      import QtQuick.Controls 2.2
      
      ApplicationWindow {
          visible: true
          width: 200; height: 200
          Button {
              width: 100; height: 50
              text: "Drag me"
              onClicked: console.log("clicked")
              DragHandler { }
          }
      }
      

      The initial problem occurs in

      void QQuickWindowPrivate::deliverMatchingPointsToItem(QQuickItem *item, QQuickPointerEvent *pointerEvent, bool handlersOnly) {
          ...
           if (pointerEvent->allPointsAccepted() && !pointerEvent->isReleaseEvent()) 
              return;
          ....
      }
      

      That is, if the DragHandler is interested, it does a passive grab and accepts the eventpoint. (Shouldn't it?) And then we don't deliver to the Button. So maybe it should check allPointsGrabbed() instead. Well, if I do that, then we have the opposite problem: the Button grabs, and the DragHandler doesn't get updates, despite having a passive grab.

      So again this proves that we need to make it deliver to passive grabbers regardless of the exclusive grab, IMO.

      Attachments

        Issue Links

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

          Activity

            People

              srutledg Shawn Rutledge
              srutledg Shawn Rutledge
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes