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)
원격 클라이언트로 message JSON을 전송합니다. 구현은 메시지를 직렬화하여 원격 JavaScript 클라이언트로 전송합니다.
© 2025 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.