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

QML Dial with stepsize set gives unexpected result

    XMLWordPrintable

Details

    • 42687caf7bc7496b838995f3fa68194ca8323da3 (qt/qtquickcontrols2/dev) 5a859441bd55178783b5dc57b0429f2aa7bb8634 (qt/qtquickcontrols2/6.1) f9bc1b540413466b53ecf6d15016422ada314181 (qt/tqtc-qtquickcontrols2/5.15)

    Description

      When Dial is defined with stepSize 1, and snapMode as Dial.SnapAlways, results are unexpected.

          Dial {
              id: dial
              x: 350
              snapMode: Dial.SnapAlways
              stepSize: 1
              to: 8
              from: 1
              value:0
              onValueChanged:{
                  console.log(value)  // Result is 1 2 3 4 5 5.999999999999999 7 8
              }
          }
      

      It is expected that all the values should be an integer, whereas, for 6, the value is 5.999999999999999. Please refer to the attached sample

      Attachments

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

        Activity

          People

            fabiankosmale Fabian Kosmale
            shmittal Shveta Mittal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes