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

Not possible to invert WheelHandler's scroll direction

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.15
    • Fix Version/s: None
    • Labels:
      None

      Description

      While looking for a workaround for QTBUG-80064, I thought I'd try WheelHandler. I saw that you can use it declaratively with a property, which is pretty cool. However, it scrolls in the opposite direction that I want it to, even with invertible set to false:

      import QtQuick 2.15
      import QtQuick.Controls 2.15
      
      ApplicationWindow {
          width: 640
          height: 480
          visible: true
      
          ScrollView {
              id: scrollView
              contentWidth: width
              contentHeight: label.implicitHeight
              width: 320
              height: 320
              clip: true
      
              WheelHandler {
                  target: scrollView.contentItem
                  property: "contentY"
                  invertible: false
              }
      
              Label {
                  id: label
                  width: parent.width
                  wrapMode: Label.Wrap
                  text: "Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text! Whoa this is a lot of text!"
              }
          }
      }
      

      It should scroll down if the scroll wheel is scrolled down, and vice versa. The expected behaviour (in terms of scroll direction) can be seen by commenting out the WheelHandler and using Flickable's scroll handling.

        Attachments

        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:
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes