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

Programmatically specifying WebSocket QML component url fails to connect.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.7.0, 5.8.0, 5.9.0 Alpha
    • WebSockets
    • None
    • Linux, Win32, Win64

      Using the QML WebSocket Client Example as the base, which works as expected, it is easily demonstrated that the WebSocket component behavior unexpectedly changes to failing to connect by simply removing the url property declared on each and instead assigning them in the onClicked signal handler with:

      onClicked: {
      socket.url = "ws://echo.websocket.org";
      secureWebSocket.url = "wss://echo.websocket.org";
      socket.active = !socket.active
      secureWebSocket.active = !secureWebSocket.active;
      //Qt.quit();
      }

      Example attached.

      Clicking again (making the socket inactive) and then once more (to flag it as active again) then opens a stable connection.

        1. wstest.qml
          4 kB
          Daniel O'Neill
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            kurt.pattyn Kurt Pattyn
            danieloneill Daniel O'Neill
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes