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

ScrollBar steals mouse events if hidden

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.14.2
    • Quick: Controls 2
    • None
    • All

    Description

      If the policy of a ScrollBar is set to Qt.ScrollBarAsNeeded, when it is not needed, it steals mouse events. A workaround can be toggling the policy between Qt.ScrollBarAlwaysOff and Qt.ScrollBarAlwaysOn appropriately, but if we do that, what's the purpose of having a Qt.ScrollBarAsNeeded policy?

      An example is provided. In this case a ListView with 10 delegates. When you make the Window big enough so the scroll bar is not needed, you can see that clicking in the rightmost side of any delegates is useless. You may think "why should you click there?", and a possible answer can be just because you wanted to do so, however with complex UIs or custom (bigger) scroll bars you may end loosing very valuable space.

      Note: It is not actually related to this bug, but there's another bug here. In the Material style, if you press a delegate you will see the Material ripple, but do it again without removing the mouse outside the button and you will not see it, despite the button was clicked and clicked() signal is emitted, giving the feeling that the button was not clicked the second time.

      The example can be executed with qmlscene.

      Example code:

      ScrollBarStealsMouseEvents.qml

      Attachments

        Issue Links

          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
              ceperez1996 Carlos Pérez
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes