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

Don't emit valueChanged signal at the initial binding evaluation

XMLWordPrintable

      Code

      import QtQuick
      
      Window {
          id: root
          width: 640
          height: 480
          visible: true
      
          property int constVal: 100
          property int boundVal: true ? 100 : 100
      
          onConstValChanged: console.log("constValChanged:", root.constVal)
          onBoundValChanged: console.log("boundValChanged:", root.boundVal)
      }
      

       

      Outcomes on Qt 6.8.1
      When the app starts up...

      • ...we see "boundValChanged: 100"
      • ...we don't see ""constValChanged"

       

      Suggestion
      Both constVal and boundVal should behave the same, from the point of view of valueChanged signals

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

            qtqmlteam Qt Qml Team User
            skoh-qt Sze Howe Koh
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes