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

should be able to add a TapHandler to a Button to modify behavior

    XMLWordPrintable

Details

    • 0f85202699 (qt/qtdeclarative/dev) 25ab62cce5 (qt/qtdeclarative/6.4) 25ab62cce5 (qt/tqtc-qtdeclarative/6.4) 0f85202699 (qt/tqtc-qtdeclarative/dev) 25ab62cce5 (qt/qtdeclarative/6.4.1), 29a2f67a8 (dev), 5855ba626 (6.4), 978bb5085 (6.5)

    Description

      In 5.15, with this code, if you right-click on the Button you get the tapped signal from TapHandler:

      import QtQuick 2.15
      import QtQuick.Controls 2.15
      
      Rectangle {
          color: dh.active ? "steelblue" : th.pressed ? "lightgreen" : "beige"
          Button {
              DragHandler {
                  id: dh
                  target: null
                  onActiveChanged: print("dragging?", active)
              }
              TapHandler {
                  id: th
                  acceptedButtons: Qt.RightButton
                  onTapped: print("open context menu")
      onCanceled: print("CANCELLED")
              }
          }
      }
      

      Whereas in Qt 6 you get canceled.  It seems the behavior change comes from https://codereview.qt-project.org/c/qt/qtdeclarative/+/349211

      Attachments

        Issue Links

          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
              srutledg Shawn Rutledge
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes