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

Setting the default value of a property to an enumeration value triggers on<Property>Changed signal.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.0.0
    • 4.7.4, 4.8.0
    • None
    • Windows 7 64-bit using 4.8.0 and 4.7.4. Also reproducible on Symbian Belle.
    • 4c9d326230a2c522bc8fd80eee9664c7d0c1205f

    Description

      When setting the default value of a property to an enumeration value, its on<Property>Changed signal is triggered. If the property is set to an integer directly, the signal isn't triggered. Setting default values for properties shouldn't trigger on<Property>Changed.

      The following code outputs:

       "Status in second item changed to:9"
      import QtQuick 1.1
      
      Rectangle {
          width: 200;
          height: 200;
          Item {
              property int status: 9
              onStatusChanged: console.log("Status in first item changed to:" + status)
          }
      
          Item {
              property int status: Qt.blue // Use any enumeration value, either from system or own.
              onStatusChanged: console.log("Status in second item changed to:" + status)
          }
      }
      

      This is the root cause for qt-components issue:
      https://bugreports.qt.nokia.com/browse/QTCOMPONENTS-1199

      Attachments

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

        Activity

          People

            chriadam Christopher Adams (closed Nokia identity) (Inactive)
            mifagerl Mikael Fagerlund
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes