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

Change handlers behave differently for aliases and properties at startup

    XMLWordPrintable

Details

    Description

      import QtQuick
      
      Item {
          property color superbColor: txt.color
          property int value: 0
          Text {
              id: txt
              text: "blue"
              color: "blue"
          }
          onSuperbColorChanged: {
              value++;
              console.log("value is: ", value);
          }
      }

      prints 1

      import QtQuick
      
      Item {
          property alias superbColor: txt.color
          property int value: 0
          Text {
              id: txt
              text: "blue"
              color: "blue"
          }
          onSuperbColorChanged: {
              value++;
              console.log("value is: ", value);
          }
      }
      

      prints nothing

      Attachments

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

        Activity

          People

            qtqmlteam Qt Qml Team User
            olivier.decanniere Olivier De Cannière
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes