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

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

    XMLWordPrintable

    Details

      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

            Assignee:
            qt.team.quick.subscriptions Qt Quick and Widgets Team
            Reporter:
            henning Henning Gr√ľndl
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes