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

Properties set in state changes bounce before being set the correct value

    XMLWordPrintable

Details

    Description

      Hi,

      In the attached example I have two states "on" and "off" that once set the value of a bool property to either true or false.

      The expected result is that at each click the value of "foobar" will go from true to false or vice-versa, only once. The observed behavior in Beta 2 is that the value goes from false to true, then to false, then to true again... This bouncing can of course lead to unexpected behavior when some other item is watching for changes in this property.

      Also, I noticed that in my example I set the value of "foobar" to a binding that always evaluate to true or to false, but if instead of doing that, I set it to a literal "true" or "false" value, I don't get the error. See the attached example where it says to uncomment a few lines to workaround the bug.

      To reproduce the bug, run the example and click a few times on the item. Watch the number of changes (increasing 3 units at a time rather than once) and also the console output.

      Attachments

        1. Switch.qml
          3 kB
          Eduardo Fleury
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            brasser Michael Brasser (closed Nokia identity) (Inactive)
            fleury Eduardo Fleury
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes