本页内容

QNdefNfcIconRecord Class

QNdefNfcIconRecord 类提供了一个用于存储图标的 NFC MIME 记录。更多内容...

头文件: #include <QNdefNfcIconRecord>
CMake: find_package(Qt6 REQUIRED COMPONENTS Nfc)
target_link_libraries(mytarget PRIVATE Qt6::Nfc)
qmake: QT += nfc
自: Qt 5.2
继承自: QNdefRecord

公共函数

QNdefNfcIconRecord()
QNdefNfcIconRecord(const QNdefRecord &other)
QByteArray data() const
void setData(const QByteArray &data)

详细说明

该类将图像数据封装为一个 NDEF 消息。它提供了一个类型为 `QNdefRecord::Mime` 的 NDEF 记录。payload() 包含原始图像数据。

成员函数文档

QNdefNfcIconRecord::QNdefNfcIconRecord()

创建一个类型为QNdefRecord::Mime 的空NDEF记录。

QNdefNfcIconRecord::QNdefNfcIconRecord(const QNdefRecord &other)

创建一个NDEF图标记录,该记录是other 的副本。

QByteArray QNdefNfcIconRecord::data() const

返回图标数据,格式为QByteArray 。

警告: 建议应用程序开发人员 在处理返回的数据之前对其进行验证。请参阅《Qt NFC 安全注意事项》以获取相关指导。

另请参阅 setData()。

void QNdefNfcIconRecord::setData(const QByteArray &data)

将图标记录的内容设置为data 。

另请参阅 data()。

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