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

webchannel: QObject signal parameters not converted

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.6.2, 5.7.1
    • 5.6.0
    • WebChannel
    • None
    • Server: Qt 5.6.0 on ARM running embedded Linux
      Client: node.js on Ubuntu

    Description

      Signal parameters that are of type QObject are not converted to object references at the client when the signal is emitted.

      For example, at the server:

      class SomeClass : public QObject
      {
        ...
      signals:
        void testSignal(QObject*);
        ...
      }
      

      At a JavaScript client:

      obj.testSignal.connect(function(objParam) {
        console.log(objParam.__id__);
      });
      

      The above will log "undefined" to the console with the signal is emitted.

      The server does appear to properly serialize the object reference, so the following change to qwebchannel.js seems to help:

           this.signalEmitted = function(signalName, signalArgs)
           {
      -        invokeSignalCallbacks(signalName, signalArgs);
      +        invokeSignalCallbacks(signalName, this.unwrapQObject(signalArgs));
           }
      

      Attachments

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

        Activity

          People

            milianw Milian Wolff
            awebster Andrew Webster
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes