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

ScrollView consumes wheel events even when 'wheelEnabled' is set false

    XMLWordPrintable

Details

    • Windows
    • 7ef12715ba (qt/qtdeclarative/dev) 7ef12715ba (qt/tqtc-qtdeclarative/dev) 75090f2357 (qt/qtdeclarative/6.3) db3c6f1238 (qt/qtdeclarative/6.4) 75090f2357 (qt/tqtc-qtdeclarative/6.3) db3c6f1238 (qt/tqtc-qtdeclarative/6.4) 75090f2357 (qt/qtdeclarative/6.3.2)

    Description

      When 'wheelEnabled' is set 'false' in ScrollView and it has a child Flickable, it still filters flickable's wheel events and causes wheel event to be consumed in flickable even if flickable does not handle wheel events itself, when its 'interactive' property is set 'false'.

       

      Example code:

      import QtQuick
      import QtQuick.Window
      import QtQuick.Controls
      
      Window
      {
        width: 500
        height: 500
      
        MouseArea
        {
          anchors.fill: parent
      
          onWheel:
          {
            // Never comes here...
            console.log("Parent item properly got wheel.");
          }
      
          ScrollView
          {
            anchors.fill: parent
            // Even when wheel is not enabled, it still filters wheel events from flickable
            // and returns that the event was filtered, which causes event to be consumed
            // in flickable and not to be propagated further to parents even though interactive
            // is set to false in flickable. Logging shows:
            //
            // qt.quick.wheel.target: QWheelEvent(Qt::NoScrollPhase, pixelDelta=QPoint(0,0), angleDelta=QPoint(0,-120)) -> QQuickFlickable(0x1a8c85e38c0, parent=0x1a8c84ca1a0, geometry=0,0 483x500)
            wheelEnabled: false
      
            Flickable
            {
              contentHeight: 1000
              interactive: false // should be no wheel handling
      
              Item
              {
                width: 500
                height: 1000
              }
            }
          }
        }
      }
      
      

      Attachments

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

        Activity

          People

            mitch_curtis Mitch Curtis
            -mtuokko- Mikko Tuokko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes