QOpcUaLocalizedText Class
OPC UA 本地化文本类型。更多
头文件: | #include <QOpcUaLocalizedText> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS OpcUa) target_link_libraries(mytarget PRIVATE Qt6::OpcUa) |
qmake: | QT += opcua |
属性
公共职能
QOpcUaLocalizedText() | |
QOpcUaLocalizedText(const QString &locale, const QString &text) | |
QOpcUaLocalizedText(const QOpcUaLocalizedText &rhs) | |
QString | locale() const |
void | setLocale(const QString &locale) |
void | setText(const QString &text) |
QString | text() const |
QVariant | operator QVariant() const |
QOpcUaLocalizedText & | operator=(const QOpcUaLocalizedText &rhs) |
bool | operator==(const QOpcUaLocalizedText &rhs) const |
相关非成员
(since 6.3) QDebug | operator<<(QDebug debug, const QOpcUaLocalizedText &text) |
详细说明
这是 OPC UA 1.05 第 3 部分 8.5 中定义的 OPC UA LocalizedText 类型的Qt OPC UA 表示法。LocalizedText 值包含一个文本字符串,在第二个字符串(如 "en "或 "en-US")中包含相关的本地信息。本地信息字符串的格式为 <language>[-<country/region>]。语言通常用 ISO 639 双字母代码表示,国家/地区用 ISO 3166 双字母代码表示。也允许自定义代码(参见 OPC UA 1.05 第 3 部分,8.4)。可使用 LocalizedText 元素数组为一个值提供不同语言的多个文本字符串。
属性文档
locale : QString
所含文本的地域。必须使用修改后的 ISO 标准符号,例如en-US
。详见 OPC UA 规范 1.05 第 3 部分 8.4。
访问功能:
text : QString
文本内容。
访问函数:
成员函数文档
QOpcUaLocalizedText::QOpcUaLocalizedText()
默认情况下构建一个未设置参数的本地化文本。
QOpcUaLocalizedText::QOpcUaLocalizedText(const QString &locale, const QString &text)
使用locale 和文本text 构建本地化文本。
QOpcUaLocalizedText::QOpcUaLocalizedText(const QOpcUaLocalizedText &rhs)
从rhs 构建本地化文本。
QString QOpcUaLocalizedText::locale() const
返回 locale。
注: 属性 locale 的获取函数。
另请参阅 setLocale()。
void QOpcUaLocalizedText::setLocale(const QString &locale)
将 locale 设置为locale 。
注: 属性locale 的设置函数。
另请参阅 locale() 。
void QOpcUaLocalizedText::setText(const QString &text)
将文本设置为text 。
注: 属性text 的设置函数。
另请参阅 text() 。
QString QOpcUaLocalizedText::text() const
返回文本。
注: 属性文本的获取函数。
另请参阅 setText()。
QVariant QOpcUaLocalizedText::operator QVariant() const
将此本地化文本转换为QVariant 。
QOpcUaLocalizedText &QOpcUaLocalizedText::operator=(const QOpcUaLocalizedText &rhs)
在本地化文本中设置rhs 中的值。
bool QOpcUaLocalizedText::operator==(const QOpcUaLocalizedText &rhs) const
如果此本地化文本的值与rhs 相同,则返回true
。
相关非会员
[since 6.3]
QDebug operator<<(QDebug debug, const QOpcUaLocalizedText &text)
将本地化后的text 写入debug 输出。
此函数在 Qt 6.3 中引入。
另请参阅 QDebug 。
© 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.