本页内容

QNdefNfcTextRecord Class

QNdefNfcTextRecord 类提供了一个 NFC RTD-Text。更多内容...

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

公共类型

enum Encoding { Utf8, Utf16 }

公共函数

QNdefNfcTextRecord()
QNdefNfcTextRecord(const QNdefRecord &other)
QNdefNfcTextRecord::Encoding encoding() const
QString locale() const
void setEncoding(QNdefNfcTextRecord::Encoding encoding)
void setLocale(const QString &locale)
void setText(const QString text)
QString text() const

详细说明

RTD-Text 封装了一个用户可显示的文本记录。

成员类型文档

enum QNdefNfcTextRecord::Encoding

此枚举描述了所使用的文本编码标准。

常量值描述
QNdefNfcTextRecord::Utf80文本采用 UTF-8 编码。
QNdefNfcTextRecord::Utf161文本采用 UTF-16 编码。

成员函数文档

QNdefNfcTextRecord::QNdefNfcTextRecord()

创建一个类型为QNdefRecord::NfcRtd 的空NFC文本记录。

QNdefNfcTextRecord::QNdefNfcTextRecord(const QNdefRecord &other)

创建一个新的NFC文本记录,该记录是other 的副本。

QNdefNfcTextRecord::Encoding QNdefNfcTextRecord::encoding() const

返回内容的编码。

另请参阅 setEncoding()。

QString QNdefNfcTextRecord::locale() const

返回文本记录的区域设置。

另请参阅 setLocale()。

void QNdefNfcTextRecord::setEncoding(QNdefNfcTextRecord::Encoding encoding)

将内容的编码设置为encoding 。

另请参阅 encoding()。

void QNdefNfcTextRecord::setLocale(const QString &locale)

将文本记录的区域设置设为locale 。超过 63 字节的区域设置将被截断。

另请参阅 locale()。

void QNdefNfcTextRecord::setText(const QString text)

将文本记录的内容设置为text 。

另请参阅 text()。

QString QNdefNfcTextRecord::text() const

将文本记录的内容作为字符串返回。

另请参阅 setText()。

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