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

qwebchannel.js strange behaviour

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.7
    • WebChannel, WebSockets
    • None
    • Windows 10

      Hi, I am using qwebchannel to communicate my two applications between javascript and c++.

      I am creating sockets in javascript and I am subscribing to the disconnect signal of the websocket in cpp. When I do this, in this function of qwebchannel.js:

      this.handlePropertyUpdate = function(message)
      {
      for (var i in message.data) {
      var data = message.data[i];
      var object = channel.objects[data.object];
      if (object)

      { object.propertyUpdate(data.signals, data.properties); }

      else

      { console.warn("Unhandled property update: " + data.object + "::" + data.signal); }

      }
      channel.exec(

      {type: QWebChannelMessageTypes.idle}

      );
      }

      message.data comes as an array so in the iteration, we are overpassing the limits of the arrays and I am receiving unhandled exceptions.

      For my particular case, the error could be resolve changing the loop for a normal for until the end of the array.

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

            milianw Milian Wolff
            ars1614 Adrián Ramos
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes