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

[REG 5.4 - 5.5] QtQuick: Decimal value cannot be correctly set to string parameter

XMLWordPrintable

    • a9276971aa8018837b23a847b5dee3b63b39232e

      If you have a string property in the QtQuick component and you try to set a decimal value to it in JavaScript, it is set validly to an approximate of the value. For example if you set value 3.4 to a string as

      property string myString
      ...
      onSomeSignalHandler: myString = 3.4
      

      the value of myString is 3.3999999999999999. And for example with 1.1 the value is 1.1000000000000001.

      The problem is not reproducible in Qt 5.4.2.

      An example attached to reproduce the problem.

        1. qtbug47070.zip
          2 kB
          Qt Support
        For Gerrit Dashboard: QTBUG-47070
        # Subject Branch Project Status CR V

            ulherman Ulf Hermann
            qtcomsupport Qt Support
            Votes:
            2 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes