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

Taphandler propagates to background with stylus

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.8.2
    • None
    • Windows 11 based development environment.
    • Android

    Description

      My example has an active Popup with modal set to true.
      The background rectangle still accepts tap events when using a stylus.
      Non-stylus touch events are ignored as expected.

      import QtQuick
      import QtQuick.Controls

      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
          color: "#FFFFFF"
          Button {
              id: popupBtn
              text: "Show popup"
              onClicked:

      {             myPopup.visible = true         }

          }
          Button {
              id: lblBtn
              anchors.left: popupBtn.right
              text: "Change label"
              onClicked:

      {             testLabel.text = "Button clicked"         }

          }
          Rectangle {
              id: rect
              anchors.left: lblBtn.right
              color: "#00FF00"
              width: 30
              height: 30
              TapHandler {
                  // grabPermissions: PointerHandler.CanTakeOverFromAnything
                  onTapped:

      {                 testLabel.text = "Rect clicked"             }

              }
          }

          Popup {
              id: myPopup
              anchors.centerIn: parent
              visible: false
              modal: true
              closePolicy: Popup.NoAutoClose
              width: 300
              height : 200
              dim: true
              Rectangle {
                  anchors.fill : parent
                  color: "#F0F0F0"
                  Text

      {                 text: "Popup text"                 anchors.centerIn: parent             }

                  Button {
                      id: closebutton
                      text: "Close me"
                      onClicked:

      {                     myPopup.visible = false                 }

                  }
                  TapHandler

      {                 gesturePolicy: TapHandler.WithinBounds                 grabPermissions: PointerHandler.TakeOverForbidden             }

              }
          }
          Label

      {         id: testLabel         anchors.left: rect.right         text: "Test 1"     }

      }

      Attachments

        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
            tielman Tielman Meyer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes