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

[Regression: 5.5 -> 5.6] PropertyChanges no longer properly restores binding on alias

    XMLWordPrintable

Details

    Description

      The following example demonstrates the issue:

      // Test.qml
      import QtQuick 2.0
      
      Item {
          id: root
      
          property string myText: "hello world"
      
          ChangeTest {
              id: changeTest
              text: myText
          }
      
          states: State {
              name: "changed"
              PropertyChanges {
                  target: changeTest
                  text: ""
              }
          }
      
          MouseArea {
              anchors.fill: parent
              onClicked: {
                  if (root.state == "")
                      root.state = "changed"
                  else {
                      root.state = ""
                      myText = "goodbye"
                  }
              }
          }
      }
      
      //ChangeTest.qml
      import QtQuick 2.0
      
      Item {
          property alias text: myText.text
      
          Text {
              id: myText
          }
      }
      

      When clicking a second time, the text should change to "goodbye". Instead, with Qt 5.6 (and a recent dev) it stays as "hello world"

      Attachments

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

        Activity

          People

            mbrasser Michael Brasser
            mbrasser Michael Brasser
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes