保持 Qt Remote Objects 网络可用客户端后端有关信息的类。 更多...
头: | #include <QtROClientFactory> |
CMake: |
find_package(Qt6 COMPONENTS RemoteObjects REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::RemoteObjects) |
qmake: | QT += remoteobjects |
void | qRegisterRemoteObjectsClient (const QString & id ) |
Registers the Remote Objects client
id
为类型
T
.
If you need a custom transport protocol for Qt Remote Objects, you need to register the client & server implementation here.
注意:
此函数要求
T
is a fully defined type at the point where the function is called.
此范例注册类
CustomClientIo
as
"myprotocol"
:
qRegisterRemoteObjectsClient<CustomClientIo>(QStringLiteral("myprotocol"));
With this in place, you can now instantiate nodes using this new custom protocol:
QRemoteObjectNode client(QUrl(QStringLiteral("myprotocol:registry")));
另请参阅 qRegisterRemoteObjectsServer .