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

Unable to create signal with parameter of same type as signal's component

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.3.0
    • None
    • Windows 7, Qt 5.3

      When declaring signals in QML, it is possible to specify the type of the parameters or just use a var. As of 5.0, QML types are supported. However, it is not possible to declare a parameter to a signal that is of the same type as the Component that is declaring that signal. Ex:

      in MyObject.qml:
      signal mySignal(MyObject param)

      This throws the error "Invalid signal parameter type: MyObject"

      The use case for such a signal is if there are many of an object, and the object must pass itself through the signal so that listeners can know which instance emitted that signal. While this functionality is possible to achieve by declaring the parameter as a var, it seems that it should be possible to specify the correct type instead.

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

            Unassigned Unassigned
            kkoser Kyle Koser
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes