QAndroidParcel 类

包裹 Android Parcel 类的最重要方法。 更多...

头: #include <QtCore/private/qandroidextras_p.h>
qmake: QT += core-private
Since: Qt 6.2
状态: Preliminary

该类在开发且可能改变。

公共函数

QAndroidParcel ()
QAndroidParcel (const QJniObject & parcel )
QJniObject handle () const
QAndroidBinder readBinder () const
QByteArray readData () const
int readFileDescriptor () const
QVariant readVariant () const
void writeBinder (const QAndroidBinder & binder ) const
void writeData (const QByteArray & data ) const
void writeFileDescriptor (int fd ) const
void writeVariant (const QVariant & value ) const

详细描述

The QAndroidParcel is a convenience class that wraps the most important Android Parcel 方法。

When building with CMake, use the following commands to use private Qt Core APIs:

find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::CorePrivate)
					

成员函数文档编制

QAndroidParcel:: QAndroidParcel ()

创建新对象。

[explicit] QAndroidParcel:: QAndroidParcel (const QJniObject & parcel )

包裹 parcel 对象。

QJniObject QAndroidParcel:: handle () const

The return value is useful to call other Java API which are not covered by this wrapper

QAndroidBinder QAndroidParcel:: readBinder () const

返回 binder 按 QAndroidBinder

QByteArray QAndroidParcel:: readData () const

返回数据按 QByteArray

int QAndroidParcel:: readFileDescriptor () const

返回文件描述符

QVariant QAndroidParcel:: readVariant () const

返回数据按 QVariant

void QAndroidParcel:: writeBinder (const QAndroidBinder & binder ) const

写入 binder object. This is useful for a client to send to a server a binder which can be used by the server callback the client.

void QAndroidParcel:: writeData (const QByteArray & data ) const

Writes the provided data as a byte array

void QAndroidParcel:: writeFileDescriptor ( int fd ) const

Writes the provided fd .

void QAndroidParcel:: writeVariant (const QVariant & value ) const

Writes the provided value . The value is converted into a QByteArray before is written.