QWebChannelAbstractTransport Class
Canal de comunicación entre el servidor C++ QWebChannel y un cliente HTML/JS. Más...
| Header: | #include <QWebChannelAbstractTransport> |
| qmake: | QT += webchannel |
| Inherits: | QObject |
Funciones Públicas
| QWebChannelAbstractTransport(QObject *parent = nullptr) | |
| virtual | ~QWebChannelAbstractTransport() override |
Ranuras públicas
| virtual void | sendMessage(const QJsonObject &message) = 0 |
Señales
| void | messageReceived(const QJsonObject &message, QWebChannelAbstractTransport *transport) |
Descripción detallada
Los usuarios de QWebChannel deben implementar esta interfaz y conectar instancias de la misma al servidor QWebChannel para cada cliente que deba conectarse a QWebChannel. El ejemplo independienteQt WebChannel muestra cómo hacerlo utilizando Qt WebSockets.
Nota: El protocolo de mensajes JSON se considera interno y podría cambiar con el tiempo.
Véase también Qt WebChannel Standalone Example.
Documentación de las funciones miembro
[explicit] QWebChannelAbstractTransport::QWebChannelAbstractTransport(QObject *parent = nullptr)
Construye un objeto de transporte con la dirección parent.
[override virtual noexcept] QWebChannelAbstractTransport::~QWebChannelAbstractTransport()
Destruye el objeto de transporte.
[signal] void QWebChannelAbstractTransport::messageReceived(const QJsonObject &message, QWebChannelAbstractTransport *transport)
Esta señal debe emitirse cuando se recibe un nuevo JSON message del cliente remoto. El argumento transport debe establecerse en este objeto de transporte.
[pure virtual slot] void QWebChannelAbstractTransport::sendMessage(const QJsonObject &message)
Envía un mensaje JSON message al cliente remoto. Una implementación serializaría el mensaje y lo transmitiría al cliente remoto JavaScript.
© 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.