QRemoteObjectPendingCall Class
封装了异步方法调用的结果。更多...
| 头文件: | #include <QRemoteObjectPendingCall> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS RemoteObjects) target_link_libraries(mytarget PRIVATE Qt6::RemoteObjects) |
| qmake: | QT += remoteobjects |
| 由以下函数继承: |
公共类型
| enum | Error { NoError, InvalidMessage } |
公共函数
| QRemoteObjectPendingCall::Error | error() const |
| bool | isFinished() const |
| QVariant | returnValue() const |
| bool | waitForFinished(int timeout = 30000) |
成员类型文档
enum 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
返回远程调用的返回值。
只有当远程调用已完成且不存在error时,returnValue才有效。
bool QRemoteObjectPendingCall::waitForFinished(int timeout = 30000)
阻塞时间最长为timeout 毫秒,直至远程调用完成。
成功时返回true ,否则返回false 。
© 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.