QRemoteObjectPendingCall 类

封装异步方法调用的结果。 更多...

头: #include <QRemoteObjectPendingCall>
CMake: find_package(Qt6 REQUIRED COMPONENTS RemoteObjects)
target_link_libraries(mytarget PRIVATE Qt6::RemoteObjects)
qmake: QT += remoteobjects
继承者: QRemoteObjectPendingCallWatcher and QRemoteObjectPendingReply

公共类型

enum Error { NoError, InvalidMessage }

公共函数

QRemoteObjectPendingCall::Error error () const
bool isFinished () const
QVariant returnValue () const
bool waitForFinished (int timeout = 30000)

详细描述

成员类型文档编制

enum QRemoteObjectPendingCall:: Error

This enum type specifies the possible error values for a remote call:

常量 描述
QRemoteObjectPendingCall::NoError 0 没有出现错误。
QRemoteObjectPendingCall::InvalidMessage 1 The default error state prior to the remote call finishing.

成员函数文档编制

QRemoteObjectPendingCall::Error QRemoteObjectPendingCall:: error () const

返回错误,若有的话,从远程调用。

bool QRemoteObjectPendingCall:: isFinished () const

Returns true if the remote call has finished, false otherwise.

A finished call will include a returnValue or error .

QVariant QRemoteObjectPendingCall:: returnValue () const

Returns the return value of the remote call.

returnValue will only be valid when the remote call has finished and there are no error

bool QRemoteObjectPendingCall:: waitForFinished ( int timeout = 30000)

阻塞最多 timeout milliseconds, until the remote call has finished.

返回 true 当成功时, false 否则。