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

signal handler argument is erroneously undefined

    XMLWordPrintable

Details

    • Linux/Wayland

    Description

      I have observed this odd behaviour and I'm unsure if that is bug or if I'm doing something wrong:

       

      this code prints "undefined" (which is certainly not the case)

      signal save(MyValue value)
      
      // forwarding a signal with parameter
      onInnerSave: (value) => { 
        console.log(value)          // prints "undefined"
        root.save(value)            // calls signal which fails due to undefined
      } 

      whereas this workaround  works

      signal save(MyValue value)
      
      function saveWrapped(value) { 
        console.log(value)          // prints the correct object 
        root.save(value)            // calls signal, works just fine
      } 
      
      onInnerSave: (value) => { 
        saveWrapped(value) 
      }  

       

      Child component signal:

      signal innerSave(MyValue value)

       

      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
            eetfuk1988 Alexander Stöcker
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes