QWebChannelAbstractTransport Class
C++ QWebChannel 서버와 HTML/JS 클라이언트 간의 통신 채널. 더 보기...
| Header: | #include <QWebChannelAbstractTransport> |
| qmake: | QT += webchannel |
| Inherits: | QObject |
공개 함수
| QWebChannelAbstractTransport(QObject *parent = nullptr) | |
| virtual | ~QWebChannelAbstractTransport() override |
공개 슬롯
| virtual void | sendMessage(const QJsonObject &message) = 0 |
신호
| void | messageReceived(const QJsonObject &message, QWebChannelAbstractTransport *transport) |
상세 설명
QWebChannel 의 사용자는 이 인터페이스를 구현하고, QWebChannel 에 연결되어야 하는 모든 클라이언트에 대해 해당 인스턴스를 QWebChannel 서버에 연결해야 합니다. Qt WebChannel 독립 실행형 예제는 다음을 사용하여 이를 수행하는 방법을 보여줍니다. Qt WebSockets.
참고: JSON 메시지 프로토콜은 내부 프로토콜로 간주되며, 향후 변경될 수 있습니다.
‘Qt WebChannel ’ 독립 실행형 예제도참조하십시오 .
멤버 함수 문서
[explicit] QWebChannelAbstractTransport::QWebChannelAbstractTransport(QObject *parent = nullptr)
지정된 ` parent`을 사용하여 전송 객체를 생성합니다.
[override virtual noexcept] QWebChannelAbstractTransport::~QWebChannelAbstractTransport()
이송 객체를 삭제합니다.
[signal] void QWebChannelAbstractTransport::messageReceived(const QJsonObject &message, QWebChannelAbstractTransport *transport)
원격 클라이언트로부터 새로운 JSON message 이 수신되면 이 신호를 발신해야 합니다. ` transport ` 인수는 이 전송 객체로 설정되어야 합니다.
[pure virtual slot] void QWebChannelAbstractTransport::sendMessage(const QJsonObject &message)
원격 클라이언트에 JSON message 을 전송합니다. 구현 시 메시지를 직렬화하여 원격 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.