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

Behavior on height in a QML file is ignored

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P1: Critical
    • None
    • 5.8.0
    • None
    • tested on Linux using binary distribution and custom build

    Description

      If a component has a Behavior on height defined this Behavior is not executed:

      // SomeComponent.qml
      Item  {
        Behavior on height { ... }
      }
      

      Behavior on height defined at instantiation of the component works fine:

      // main.qml
      SomeComponent { Behavior on height { ... } }
      

      See the attached example for a demonstration: the Behavior on opacity in main.qml works while the Behavior on height in OtherComponent is ignored (the change in height is not animated).

      I have bisected qtdeclarative and think the bug was introduced by 81867dfbf QML: Introduce write accessors to QQmlAccessors .

      Edit:
      It works fine if the behavior in OtherComponent is "Behavior on opacity" - so it depends on both the property (height) and the place where the behavior is defined (in OtherComponent.qml).

      Edit 2:
      It also works fine if height is changed directly. The bug is triggered if height is changed by a binding like: height: collapsed ? 200 : 400

      Attachments

        1. behavior.zip
          2 kB
        2. behavior2.zip
          4 kB

        Issue Links

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

          Activity

            People

              erikv Erik Verbruggen
              jangmarker Jan Marker
              Votes:
              5 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes