QDBusPendingCall Class

QDBusPendingCall 클래스는 하나의 보류 중인 비동기 호출을 참조합니다. 더 보기...

헤더: #include <QDBusPendingCall>
CMake: find_package(Qt6 REQUIRED COMPONENTS DBus)
target_link_libraries(mytarget PRIVATE Qt6::DBus)
qmake: QT += dbus
상속 대상:

QDBusPendingCallWatcher

공용 함수

QDBusPendingCall(const QDBusPendingCall &other)
~QDBusPendingCall()
void swap(QDBusPendingCall &other)
QDBusPendingCall &operator=(const QDBusPendingCall &other)

정적 공용 멤버

QDBusPendingCall fromCompletedCall(const QDBusMessage &msg)
QDBusPendingCall fromError(const QDBusError &error)

상세 설명

QDBusPendingCall 객체는 응답을 기다리지 않고 D-Bus를 통해 전송된 메서드 호출에 대한 참조입니다. QDBusPendingCall은 불투명 유형으로, 대기 중인 응답에 대한 핸들로 사용하기 위한 것입니다.

대부분의 프로그램에서 QDBusPendingCall 클래스는 직접 사용되지 않습니다. 회신 내용에 액세스하거나 완료될 때까지 기다리기 위해 템플릿 기반 QDBusPendingReply 으로 안전하게 대체할 수 있습니다.

QDBusPendingCallWatcher 클래스를 사용하면 응답이 언제 도착했는지 또는 통화가 시간 초과되었는지 알려주는 신호에 연결할 수 있습니다. 또한 응답이 도착할 때까지 프로그램 실행을 일시 중단하는 QDBusPendingCallWatcher::waitForFinished() 메서드도 제공합니다.

참고: QDBusPendingCall 객체의 복사본을 만들면 모든 정보가 여러 복사본 간에 공유됩니다. 따라서 QDBusPendingCall은 명시적으로 공유되는 객체이며 복사본을 분리하는 메서드를 제공하지 않습니다(동일한 보류 중인 호출을 참조하기 때문에).

QDBusPendingReplyQDBusPendingCallWatcher참조하십시오 .

멤버 함수 문서

QDBusPendingCall::QDBusPendingCall(const QDBusPendingCall &other)

other 보류 중인 비동기 호출의 복사본을 만듭니다. 두 객체 모두 동일한 보류 중인 호출을 참조합니다.

[noexcept] QDBusPendingCall::~QDBusPendingCall()

QDBusPendingCall 객체의 이 복사본을 삭제합니다. 이 복사본이 보류 중인 비동기 호출의 마지막 복사본이기도 하면 호출이 취소되고 더 이상 알림이 수신되지 않습니다. 답장이 도착하면 답장의 내용에 액세스할 수 있는 방법이 없습니다.

[static] QDBusPendingCall QDBusPendingCall::fromCompletedCall(const QDBusMessage &msg)

msg 메시지를 기반으로 QDBusPendingCall 객체를 만듭니다. 메시지는 QDBusMessage::ErrorMessage 또는 QDBusMessage::ReplyMessage 유형이어야 합니다(즉, 완료된 호출의 일반적인 메시지).

이 함수는 보류 중인 호출을 시뮬레이션해야 하지만 이미 완료된 호출을 시뮬레이션해야 하는 코드에 유용합니다.

fromError()도 참조하세요 .

[static] QDBusPendingCall QDBusPendingCall::fromError(const QDBusError &error)

오류 조건 error 을 기반으로 QDBusPendingCall 객체를 생성합니다. 결과 보류 중인 호출 개체는 "완료" 상태가 되고 QDBusPendingReply<Types...>::isError()는 참을 반환합니다.

fromCompletedCall()도 참조하세요 .

[noexcept] void QDBusPendingCall::swap(QDBusPendingCall &other)

이 보류 중인 호출 인스턴스를 other 로 바꿉니다. 이 작업은 매우 빠르며 실패하지 않습니다.

QDBusPendingCall &QDBusPendingCall::operator=(const QDBusPendingCall &other)

other 보류 중인 비동기 호출의 복사본을 생성하고 이전에 참조한 호출에 대한 참조를 삭제합니다. 이 함수 이후 두 객체는 동일한 보류 중인 호출을 참조하게 됩니다.

이 객체에 보류 중인 비동기 호출의 마지막 참조가 포함되어 있으면 호출이 취소되고 더 이상 알림이 수신되지 않습니다. 답장이 도착하면 답장의 내용에 액세스할 수 있는 방법이 없습니다.

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