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

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

XMLWordPrintable

      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")
          }
      }
      

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

            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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes