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

Allows set wheel deceleration to Flickable

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 6.0.0
    • None
    • All

    Description

      We are dealing with an issue in the "application launcher" program in the Linux desktop environment, which has two types of scrollable areas:

      a. A horizontally laid out list of program icons and names, which is a ListView. In this mode, the program icons are small, and the height of each row in the ListView is about 30px. So, this ListView is relatively small, needing only a few hundred pixels in height to display 10 rows of applications. In this list, we want the scrolling to have a slower acceleration because using a faster acceleration could cause scrolling out of many rows when the mouse wheel is triggered, pushing the desired row out of the window.

      b. A vertically laid out list of program icons and names, which is a GridView. In this mode, the program icons are large, and the cell size of the GridView is about 120px. This GridView is also quite large, almost the height of the screen, because of the large icons. So, a large GridView is needed to display as many icons as possible. In this GridView, we want the scrolling to have a faster acceleration because of the large icons; users would want to scroll quickly to find the program they want to launch.

      I have uploaded a demo program with two windows. The smaller window contains a ListView, and the larger window contains a GridView. In the main.cpp file, I forwarded the Wheel event of the window containing the ListView to the window containing the GridView. So, you only need to scroll the ListView with the mouse wheel to see the GridView scrolling together. This accurately simulates the problem we encounter in our project. I have set the acceleration value of Wheel to 3500 using an environment variable. When the mouse wheel triggers the Wheel event three times continuously, the items in the ListView scroll to the 16th row (the user misses the opportunity to operate rows 12-15), and the items in the GridView scroll to the 4th row. 3500 is a suitable value for the GridView, but not for the ListView.

      Currently, QtQuick can only set the acceleration of Wheel through environment variables and cannot set different values for different Flickables. In the example in the attachment, users need to be careful when using this program. When they get used to the feel of scrolling the view in the GridView, if they switch to the ListView view, they need to readjust the scrolling feel to make the mouse wheel slower. This is not a user-friendly experience.

      -----------------------------------------------------------------------------------------------------------------------

      The untitled application screenshot on startup:

      The untitled application screenshot on scroll by mosue:

      Application Log

      virtual bool EventShare::eventFilter(QObject*, QEvent*) List_QMLTYPE_0(0x58a0adbcfd20, name = "Needs small wheel deceleration") QWheelEvent(Qt::NoScrollPhase, pixelDelta=QPoint(0,-120), angleDelta=QPoint(0,-120))
      virtual bool EventShare::eventFilter(QObject*, QEvent*) Grid_QMLTYPE_2(0x58a0add02d90, name = "Needs large wheel deceleration") QWheelEvent(Qt::NoScrollPhase, pixelDelta=QPoint(0,-120), angleDelta=QPoint(0,-120))
      qt.quick.flickable.wheel: QInputDevice(QPointingDevice("YSPRINGTECH USB OPTICAL MOUSE" Mouse id=10 seat=30002 caps=Position|Scroll|Hover) QWheelEvent(Qt::NoScrollPhase, pixelDelta=QPoint(0,-120), angleDelta=QPoint(0,-120)) Qt::MouseEventNotSynthesized
      qt.quick.flickable.wheel: QInputDevice(QPointingDevice("YSPRINGTECH USB OPTICAL MOUSE" Mouse id=10 seat=30002 caps=Position|Scroll|Hover) QWheelEvent(Qt::NoScrollPhase, pixelDelta=QPoint(0,-120), angleDelta=QPoint(0,-120)) Qt::MouseEventNotSynthesized
      virtual bool EventShare::eventFilter(QObject*, QEvent*) List_QMLTYPE_0(0x58a0adbcfd20, name = "Needs small wheel deceleration") QWheelEvent(Qt::NoScrollPhase, pixelDelta=QPoint(0,-120), angleDelta=QPoint(0,-120))
      virtual bool EventShare::eventFilter(QObject*, QEvent*) Grid_QMLTYPE_2(0x58a0add02d90, name = "Needs large wheel deceleration") QWheelEvent(Qt::NoScrollPhase, pixelDelta=QPoint(0,-120), angleDelta=QPoint(0,-120))
      qt.quick.flickable.wheel: QInputDevice(QPointingDevice("YSPRINGTECH USB OPTICAL MOUSE" Mouse id=10 seat=30002 caps=Position|Scroll|Hover) QWheelEvent(Qt::NoScrollPhase, pixelDelta=QPoint(0,-120), angleDelta=QPoint(0,-120)) Qt::MouseEventNotSynthesized
      qt.quick.flickable.wheel: QInputDevice(QPointingDevice("YSPRINGTECH USB OPTICAL MOUSE" Mouse id=10 seat=30002 caps=Position|Scroll|Hover) QWheelEvent(Qt::NoScrollPhase, pixelDelta=QPoint(0,-120), angleDelta=QPoint(0,-120)) Qt::MouseEventNotSynthesized
      virtual bool EventShare::eventFilter(QObject*, QEvent*) List_QMLTYPE_0(0x58a0adbcfd20, name = "Needs small wheel deceleration") QWheelEvent(Qt::NoScrollPhase, pixelDelta=QPoint(0,-120), angleDelta=QPoint(0,-120))
      virtual bool EventShare::eventFilter(QObject*, QEvent*) Grid_QMLTYPE_2(0x58a0add02d90, name = "Needs large wheel deceleration") QWheelEvent(Qt::NoScrollPhase, pixelDelta=QPoint(0,-120), angleDelta=QPoint(0,-120))
      qt.quick.flickable.wheel: QInputDevice(QPointingDevice("YSPRINGTECH USB OPTICAL MOUSE" Mouse id=10 seat=30002 caps=Position|Scroll|Hover) QWheelEvent(Qt::NoScrollPhase, pixelDelta=QPoint(0,-120), angleDelta=QPoint(0,-120)) Qt::MouseEventNotSynthesized
      qt.quick.flickable.wheel: QInputDevice(QPointingDevice("YSPRINGTECH USB OPTICAL MOUSE" Mouse id=10 seat=30002 caps=Position|Scroll|Hover) QWheelEvent(Qt::NoScrollPhase, pixelDelta=QPoint(0,-120), angleDelta=QPoint(0,-120)) Qt::MouseEventNotSynthesized

      I'm using Linux/X11 with a mouse from the microkingdom brand. I'm not sure if you can observe the same phenomenon on other operating systems or with mice from other brands, so I recorded a video.

      ------------------------------------------------------------------------------------------------------------------------

      Attachments

        1. GridView.png
          GridView.png
          672 kB
        2. ListView.png
          ListView.png
          488 kB
        3. screenshot-1.png
          screenshot-1.png
          219 kB
        4. screenshot-2.png
          screenshot-2.png
          234 kB
        5. untitled.zip
          5 kB
        6. video.mp4
          5.55 MB
        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
            zccrs JiDe Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes