QRemoteObjectPendingCall类
封装了异步方法调用结果。[更多](#details)
| 头文件 | #include <QRemoteObjectPendingCall> | 
| CMake | find_package(Qt6 REQUIRED COMPONENTS RemoteObjects) target_link_libraries(mytarget PRIVATE Qt6::RemoteObjects) | 
| qmake | QT += remoteobjects | 
| 继承自 | 
公共类型
| 枚举 | Error { NoError, InvalidMessage } | 
公共函数
| QRemoteObjectPendingCall::Error | error() const | 
| bool | isFinished() const | 
| QVariant | returnValue() const | 
| bool | waitForFinished(int timeout = 30000) | 
成员类型文档
枚举 QRemoteObjectPendingCall::Error
这个枚举类型指定了远程调用可能出现的错误值
| 常量 | 值 | 描述 | 
|---|---|---|
| QRemoteObjectPendingCall::NoError | 0 | 没有发生错误。 | 
| QRemoteObjectPendingCall::InvalidMessage | 1 | 远程调用完成之前的默认错误状态。 | 
成员函数文档
QRemoteObjectPendingCall::Error QRemoteObjectPendingCall::error() const
返回远程调用中的错误,如果有的话。
bool QRemoteObjectPendingCall::isFinished() const
如果远程调用已经完成,则返回true,否则返回false。
完成调用将包含一个 returnValue 或 error。
QVariant QRemoteObjectPendingCall::returnValue() const
返回远程调用的返回值。
returnValue只有在远程调用完成且没有错误时才有效。
bool QRemoteObjectPendingCall::waitForFinished(int timeout = 30000)
最多阻塞 timeout 毫秒,直到远程调用完成。
在成功时返回 true,否则返回 false。
© 2024 The Qt Company Ltd. 本文档中包含的贡献文档的版权归其各自所有者所有。提供的文档遵照由自由软件基金会发布的 GNU自由文档许可协议版本1.3 的条款。Qt及其相关标志是The Qt Company Ltd.在芬兰及其他国家的商标。所有其他商标均为各自所有者的财产。