QtROServerFactory Class

Qt Remote Objects 네트워크에서 사용할 수 있는 서버 백엔드에 대한 정보를 보유하는 클래스입니다. 더 보기...

헤더: #include <QtROServerFactory>
CMake: find_package(Qt6 REQUIRED COMPONENTS RemoteObjects)
target_link_libraries(mytarget PRIVATE Qt6::RemoteObjects)
qmake: QT += remoteobjects
void qRegisterRemoteObjectsServer(const QString &id)

상세 설명

관련 비회원

template <typename T> void qRegisterRemoteObjectsServer(const QString &id)

원격 객체 서버 idT 유형에 등록합니다.

Qt Remote Objects 에 대한 사용자 정의 전송 프로토콜이 필요한 경우 여기에 클라이언트 및 서버 구현을 등록해야 합니다.

참고: 이 함수를 사용하려면 함수가 호출되는 시점에 T 유형이 완전히 정의되어 있어야 합니다.

이 예에서는 CustomServerImpl 클래스를 "myprotocol" 으로 등록합니다:

qRegisterRemoteObjectsServer<CustomServerImpl>(QStringLiteral("myprotocol"));

이렇게 하면 이제 이 새로운 사용자 정의 프로토콜을 사용하여 노드를 인스턴스화할 수 있습니다:

QRemoteObjectNode client(QUrl(QStringLiteral("myprotocol:registry")));

qRegisterRemoteObjectsServer도 참조하세요 .

© 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.