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

QListView does not update single step property of its vertical scrollbar correctly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Incomplete
    • Affects Version/s: 5.15.6
    • Fix Version/s: None
    • Component/s: Widgets: Itemviews
    • Labels:
      None
    • Platform/s:
      Windows

      Description

      Normally, QListView with scroll mode set to QAbstractItemView::ScrollPerItem (which is the default) should set the single step size of its vertical scrollbar to such a value that scrolling with the mousewheel will scroll the items in the view in multiples of the item size. This works well in both view modes QListView::ListMode and QListView::IconMode.

      However, when the view was previously in ListMode and then is switched to IconMode, this stops to work as the vertical scrollbar's singleStep will be set to 1 and will not be updated to any different value. Changing the view's gridSize or IconSize properties has no effect on the scrollbar anymore, it will just stay locked at this single step of 1. This is very inconvenient, as scrolling with the mousewheel will scroll the view's contents pixel by pixel, which is way to slow.

      This is caused by QListModeViewBase::updateVerticalScrollBar(const QSize &step), which is used when the view is in list mode. It sets the scrollbar to a single step of one, thereby setting the flag QAbstractSliderPrivate::viewMayChangeSingleStep to false, which will later block any attempt from the view to set a different value.

      The only way to enable single step updates by the view, is to call setSingleStep(-1) on the scrollbar, which will reset this flag and make updates working again.

        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:
            florianb82 Florian Benz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes