QAndroidBinder Class
Android Binder 클래스의 가장 중요한 메서드들을 래핑합니다. 더 보기...
| 헤더: | #include <QtCore/private/qandroidextras_p.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS CorePrivate) target_link_libraries(mytarget PRIVATE Qt6::CorePrivate) |
| qmake: | QT += core-private |
| 다음부터: | Qt 6.2 |
| 상태: | 기술 미리보기 |
이 클래스는 기술 미리보기 단계에 있으며 변경될 수 있습니다.
공개 유형
| enum class | CallType { Normal, OneWay } |
공개 함수
| QAndroidBinder() | |
| QAndroidBinder(const QJniObject &binder) | |
| QJniObject | handle() const |
| virtual bool | onTransact(int code, const QAndroidParcel &data, const QAndroidParcel &reply, QAndroidBinder::CallType flags) |
| bool | transact(int code, const QAndroidParcel &data, QAndroidParcel *reply = nullptr, QAndroidBinder::CallType flags = CallType::Normal) const |
상세 설명
QAndroidBinder는 가장 중요한 Android Binder 메서드를 래핑하는 편의 클래스입니다.
멤버 유형 문서
enum class QAndroidBinder::CallType
이 열거형은 ` QAndroidBinder::transact()`와 함께 사용되어 IPC 호출이 수행되는 모드를 설명합니다.
| 상수 | 값 | 설명 |
|---|---|---|
QAndroidBinder::CallType::Normal | 0 | 일반 IPC. 호출자가 피호출자의 결과를 기다린다는 의미입니다. |
QAndroidBinder::CallType::OneWay | 1 | 단방향 IPC. 호출자가 피호출자의 결과를 기다리지 않고 즉시 반환됨을 의미합니다. |
멤버 함수 문서
[explicit] QAndroidBinder::QAndroidBinder()
IPC를 수행하는 데 사용할 수 있는 새로운 객체를 생성합니다.
onTransact 및 transact도 참조하십시오 .
QAndroidBinder::QAndroidBinder(const QJniObject &binder)
binder Java 객체를 기반으로 새로운 객체를 생성합니다.
transact도 참조하십시오 .
QJniObject QAndroidBinder::handle() const
이 반환값은 이 래퍼에서 다루지 않는 다른 Java API를 호출할 때 유용합니다.
[virtual] bool QAndroidBinder::onTransact(int code, const QAndroidParcel &data, const QAndroidParcel &reply, QAndroidBinder::CallType flags)
기본 구현은 false를 반환하는 스텁입니다. 사용자는 호출자로부터 트랜잭션 데이터를 가져오기 위해 이 메서드를 재정의해야 합니다.
code 는 수행할 액션입니다. data 는 호출자가 보낸 마셜링된 데이터입니다.
The reply is the marshaled data to be sent to the caller.
The flags are the additional operation flags.
경고: 이 메서드는 이 객체가 생성된 스레드와 다른 Binder의 스레드에서 호출됩니다.
transact도 참조하십시오 .
bool QAndroidBinder::transact(int code, const QAndroidParcel &data, QAndroidParcel *reply = nullptr, QAndroidBinder::CallType flags = CallType::Normal) const
IPC 호출을 수행합니다.
code 는 수행할 작업입니다. FIRST_CALL_TRANSACTION과 LAST_CALL_TRANSACTION 사이에 위치해야 합니다.
The data is the marshaled data to send to the target.
The reply (if specified) is the marshaled data to be received from the target. May be nullptr if you are not interested in the return value.
The flags are the additional operation flags.
성공 시 true를 반환합니다.
© 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.