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

ScrollView catches clicks on invisible scrollbars

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Duplicate
    • Affects Version/s: 5.14.2, 5.15.2, 6.0.0
    • Fix Version/s: None
    • Component/s: Quick: Controls 2
    • Labels:
      None

      Description

      Consider:

      import QtQuick 2.12
      import QtQuick.Window 2.0
      import QtQuick.Controls 2.5
      
      Window {
          visible: true
          ScrollView {
              anchors.fill: parent
              ScrollBar.horizontal.onPressedChanged: console.log("pressed")
              Flickable {
                  id: flickable
                  contentHeight: flamegraph.height
                  contentWidth: flamegraph.width
                  Rectangle {
                      id: flamegraph
      
                      width: flickable.width
                      height: flickable.height
      
                      color: "blue"
                      Component.onCompleted: console.log("completed", width, height)
      
                      MouseArea {
                          anchors.fill: parent
                          hoverEnabled: true
                          onClicked: function(mouse) {
                              console.log("clicked", width - mouse.x, height - mouse.y)
                          }
                      }
                  }
              }
          }
      }
      

      Now click within ~10 pixels from the lower border of the window.

      Expected output: "clicked, <x>, <y>"
      Observed output: "pressed"

      In other words, even though the scrollbar is invisible, it still receives clicks, and blocks those same clicks from being delivered to the MouseArea below.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              qt.team.quick.subscriptions Qt Quick and Widgets Team
              Reporter:
              ulherman Ulf Hermann
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes