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

[Reg 5.15 -> 6.2] Item ignores the initial size from a binding when implicit size is used with Behavior

    XMLWordPrintable

    Details

    • Commits:
      aa4e5d5982 (qt/qtdeclarative/dev) ab22b8bbd3 (qt/qtdeclarative/6.2) ab22b8bbd3 (qt/tqtc-qtdeclarative/6.2) 63712d9f9d (qt/qtdeclarative/6.3)

      Description

      The issue title may be a bit confusing. It's simpler to show on a minimal example.

      import QtQuick 2.0
      
      Item
      {
          width: 400
          height: 400
      
          Rectangle
          {
              color: "yellow"
              implicitWidth: 50
              implicitHeight: 50
              height: { return 0 }
              Behavior on height { NumberAnimation { duration: 300 } }
          }
      }
      

      There's implicitHeight set for the Rectangle. Also height is set to be zero via a binding. The expected height of the item in this case is 0. But if there's  a Behavior on height, the initial value from the binding is not applied and the resulting height is 50.

      In Qt 5 the issue does not exist, and the resulting item height is 0.

       

      Some details:

      • It does not matter what the binding returns. It may be 0, it may be 12345. Any value is ignored.
      • The binding is not killed by something. If its value could be changed, the Behavior will animate the height. For example I can declare a property, bind height to its value, and later change the property. The Behavior will play the animation.

       

        Attachments

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

          Activity

            People

            Assignee:
            ulherman Ulf Hermann
            Reporter:
            kds Denis Klychkov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: