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

TapHandler over Flickable blocks interaction with Flickable by mouse but not by touch

    XMLWordPrintable

Details

    Description

      Hi, I discovered this odd behavior where touch and mouse input behave differently for no obvious reason:

      If a TapHandler is in an Item that overlays a Flickable (/ListView), the Flickable does not respond do being dragged by a mouse. Interestingly, it works without an issue on a touchscreen, there the Flickable can be scrolled, and tapping triggers the TapHandler, exactly how it should be in my opinion.

      Here is a minimal example to reproduce the problem:

       

      import QtQuick
      import QtQuick.Controls
      import QtQuick.Window
      
      Window {
          id: window
          width: 500
          height: 500
          visible: true
          Flickable {
              id: flickable
              anchors.top: parent.top
              anchors.left: parent.left
              width: 300; height: 300
              contentWidth: rect.width;
              contentHeight: rect.height
              clip: true
              Rectangle {
                  id: rect
                  color: "red"
                  width: 300; 
                  height: 600
              }
              ScrollBar.vertical : ScrollBar {}
              ScrollBar.horizontal : ScrollBar {}
          }
          Item {
              anchors.fill: flickable
              TapHandler {
                  onTapped: function(eventPoint, button) {
                      print("tapped")
                  }
              }
          }
      } 

       

       

       

       

      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
            c.geist Christoph Geist
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes