Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business


QML interface to QWebSocket. More...

Import Statement: import QtWebSockets 1.1
Since: Qt 5.3




Detailed Description

WebSockets is a web technology providing full-duplex communications channels over a single TCP connection. The WebSocket protocol was standardized by the IETF as RFC 6455 in 2011.

Property Documentation

active : bool

When set to true, a connection is made to the server with the given url. When set to false, the connection is closed. The default value is false.

errorString : QString

Contains a description of the last error that occurred. When no error occurrred, this string is empty.

status : Status

Status of the WebSocket.

The status can have the following values:

  • WebSocket.Connecting
  • WebSocket.Open
  • WebSocket.Closing
  • WebSocket.Closed
  • WebSocket.Error

url : QUrl

Server url to connect to. The url must have one of 2 schemes: ws:// or wss://. When not supplied, then ws:// is used.

Signal Documentation

binaryMessageReceived(QString message)

This signal is emitted when a binary message is received.

This QML signal was introduced in Qt 5.8.

statusChanged(Status status)

This signal is emitted when the status of the WebSocket changes. the status argument provides the current status.

See also WebSocket::status.

textMessageReceived(QString message)

This signal is emitted when a text message is received.

Method Documentation

void sendBinaryMessage(ArrayBuffer message)

Sends message to the server.

This QML method was introduced in Qt 5.8.

void sendTextMessage(string message)

Sends message to the server.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded