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

need to be able to add PointerHandlers to conventional event-handling Items

XMLWordPrintable

    • 6eaa95662c2d4ba287ac5d1de5ec49bd3a9f59e6

      For example, let's make a Button draggable:

      import QtQuick 2.0
      import Qt.labs.handlers 1.0
      import QtQuick.Controls 2.2
      
      ApplicationWindow {
          visible: true
          width: 200; height: 200
          CheckBox {
              id: draggableCB
              anchors.right: parent.right
              text: "draggable"
              checked: true
          }
      
          Button {
              width: 100; height: 50
              text: "Drag me"
              onClicked: console.log("clicked")
              DragHandler { enabled: draggableCB.checked }
          }
      }
      

      It should be possible to tap the button as usual, such that it looks visually pressed when it's pressed, and emits its clicked signal on release. It should be possible to drag it. And as soon as the DragHandler takes over the exclusive grab and becomes active, the Button should no longer be pressed. We've seen several possible bugs with this already, depending on which patches we've been trying out in qtdeclarative: the Button can't be dragged at all; the Button can be dragged but can't be pressed at all; the Button is pressed and can be dragged but stays pressed even after the point is released; it works right for touch but not for mouse; vice-versa; etc.

      But this is not the only scenario. Hopefully most of the ones we can think of can be fixed during the course of the 5.10 releases.

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

            srutledg Shawn Rutledge
            srutledg Shawn Rutledge
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes