Servidor WebSocket em QML

Um exemplo simples que mostra como usar um WebSocketServer no QML.

Interface gráfica do servidor WebSocket em QML

Este exemplo abre uma janela e possui um WebSocketServer à espera de conexões recebidas e um WebSocket conectado ao WebSocketServer. Sempre que a janela é clicada, o WebSocket envia uma mensagem para o endereço WebSocketServer. O objeto WebSocketServer possui um manipulador de sinal que registra a mensagem recebida na janela e envia uma resposta, enquanto o WebSocket possui um manipulador de sinal que registra a mensagem recebida na janela.

Projeto de exemplo em code.qt.io

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.