QNdefNfcTextRecord Class

QNdefNfNcTextRecord 类提供了一个 NFC RTD 文本。更多

头文件: #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

另请参阅 locale() 。

void QNdefNfcTextRecord::setText(const QString text)

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

另请参阅 text() 。

QString QNdefNfcTextRecord::text() const

以字符串形式返回文本记录的内容。

另请参阅 setText()。

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