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

Slider always snaps if stepSize is set regardless which snapMode is used

    XMLWordPrintable

Details

    • 37d3c7817fbde6db9f95863d1d0f3d6d9b96cea3 (qt/qtquickcontrols2/dev)

    Description

      When a stepSize is set on a Slider, it doesn't matter which snapMode (Slider.NoSnap) is set, it still snaps to the given stepSize.
      Slider snapMode doc

      Slider {
          from: 0
          to: 100
          value: 32
          snapMode: Slider.NoSnap
          stepSize: 10
      }
      

      If you're investigating have a look at qquickslider.cpp:199. The handleMove() function will check if snapMode is set to SnapAlways and adjust the position.

      • If live is false it will set the position according to the actual position of the handle. Setting live to false would be a workaround, but then the user doesn't get live updates, which means everything will be update after release of the handle.
      • If live is true it either has a neglectable small stepSize or it will use stepSize regardless of what was set as snapMode to calculate the new position (see qquickslider.cpp:609).

      Attachments

        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
            henning Henning Gründl
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes