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

Slider needs a valueModified signal for non-live updates

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.12
    • Quick: Controls 2
    • None

    Description

      When using a live Slider, the moved signal can be used to be notified of changes to the value resulting from user interaction.

      When using a non-live Slider, moved cannot be used, as the value itself doesn't change until the handle is released.

      RowLayout {
          Slider {
              id: strengthSlider
              from: 1
              to: 100
              stepSize: 1
              snapMode: Slider.SnapAlways
              live: false
              onMoved: print("moved", value, valueAt(position))
          }
          Label {
              text: strengthSlider.valueAt(strengthSlider.position)
              Layout.minimumWidth: 60
          }
      }
      

      SpinBox has a valueModified signal, so that would be the most consistent choice for a name.

      For live sliders, valueModified would be emitted when the handle is moved.

      For non-live sliders, valueModified would be emitted when the handle is released after moving (assuming the value actually changed).

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            mitch_curtis Mitch Curtis
            mitch_curtis Mitch Curtis
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes