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

TapHandler doesn't emit tapped when used in container of TextField

    XMLWordPrintable

Details

    Description

      Apparently unlike QTBUG-99887, this has been an issue since Qt 5.

      Qt 5:

      import QtQuick 2.15
      import QtQuick.Controls 2.15
      
      ApplicationWindow {
          id: window
          width: 400
          height: 400
          visible: true
      
          TextField {
              text: qsTr("TextField")
              anchors.horizontalCenter: parent.horizontalCenter
          }
      
          TapHandler {
              acceptedButtons: Qt.RightButton
              gesturePolicy: TapHandler.WithinBounds
              onTapped: print("tapped")
          }
      }
      

      Qt 6:

      import QtQuick
      import QtQuick.Controls.Basic
      
      ApplicationWindow {
          id: window
          width: 400
          height: 400
          visible: true
      
          TextField {
              text: qsTr("TextField")
              anchors.horizontalCenter: parent.horizontalCenter
          }
      
          TapHandler {
              acceptedButtons: Qt.RightButton
              gesturePolicy: TapHandler.WithinBounds
              onTapped: print("tapped")
          }
      }
      

      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
              mitch_curtis Mitch Curtis
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes