本页内容

QOpcUaEnumField Class

OPC UA 的 StructureDefinition 类型。更多内容...

头文件: #include <QOpcUaEnumField>
CMake: find_package(Qt6 REQUIRED COMPONENTS OpcUa)
target_link_libraries(mytarget PRIVATE Qt6::OpcUa)
qmake: QT += opcua
自: Qt 6.7

公共函数

QOpcUaEnumField()
QOpcUaEnumField(const QOpcUaEnumField &other)
QOpcUaEnumField(QOpcUaEnumField &&other)
~QOpcUaEnumField()
QOpcUaLocalizedText description() const
QOpcUaLocalizedText displayName() const
QString name() const
void setDescription(const QOpcUaLocalizedText &description)
void setDisplayName(const QOpcUaLocalizedText &displayName)
void setName(const QString &name)
void setValue(qint64 value)
void swap(QOpcUaEnumField &other)
qint64 value() const
operator QVariant() const
QOpcUaEnumField &operator=(QOpcUaEnumField &&other)
QOpcUaEnumField &operator=(const QOpcUaEnumField &rhs)
bool operator!=(const QOpcUaEnumField &lhs, const QOpcUaEnumField &rhs)
bool operator==(const QOpcUaEnumField &lhs, const QOpcUaEnumField &rhs)

详细说明

这是Qt OPC UA 对OPC UA第3部分中定义的OPC UA EnumField类型的表示。它描述了一个枚举类型的字段。

成员函数文档

QOpcUaEnumField::QOpcUaEnumField()

默认情况下会创建一个未设置参数的枚举字段。

QOpcUaEnumField::QOpcUaEnumField(const QOpcUaEnumField &other)

根据other 生成一个枚举字段。

[constexpr noexcept default] QOpcUaEnumField::QOpcUaEnumField(QOpcUaEnumField &&other)

从 `other` 移动构造一个新的枚举字段。

注意: 被移动的对象 other 将处于部分构筑状态,在此状态下,唯一有效的操作是销毁和赋予新值。

[noexcept] QOpcUaEnumField::~QOpcUaEnumField()

销毁此枚举定义对象。

QOpcUaLocalizedText QOpcUaEnumField::description() const

返回枚举字段的描述。

另请参阅 setDescription()。

QOpcUaLocalizedText QOpcUaEnumField::displayName() const

返回枚举字段的显示名称。

另请参阅 setDisplayName()。

QString QOpcUaEnumField::name() const

返回枚举字段的名称。

另请参阅 setName()。

void QOpcUaEnumField::setDescription(const QOpcUaLocalizedText &description)

将枚举字段的描述设置为description 。

另请参阅 description()。

void QOpcUaEnumField::setDisplayName(const QOpcUaLocalizedText &displayName)

将枚举字段的显示名称设置为displayName 。

另请参阅 displayName()。

void QOpcUaEnumField::setName(const QString &name)

将枚举字段的名称设置为name 。

另请参阅 name()。

void QOpcUaEnumField::setValue(qint64 value)

将枚举字段的枚举值设置为value 。

另请参阅 value()。

[noexcept] void QOpcUaEnumField::swap(QOpcUaEnumField &other)

将枚举字段对象 `other ` 与该枚举字段对象互换。此操作速度极快,且绝不会失败。

qint64 QOpcUaEnumField::value() const

返回枚举字段的枚举值。

另请参阅 setValue()。

QOpcUaEnumField::operator QVariant() const

将此枚举字段转换为QVariant 。

[noexcept] QOpcUaEnumField &QOpcUaEnumField::operator=(QOpcUaEnumField &&other)

将other 通过移动赋值操作赋值给此QOpcUaEnumField 实例。

注意: 被移动的对象 other 将处于部分初始化状态,在此状态下,唯一有效的操作是销毁和赋值。

QOpcUaEnumField &QOpcUaEnumField::operator=(const QOpcUaEnumField &rhs)

将rhs 中的值设置为此枚举字段的值。

相关非成员

[noexcept] bool operator!=(const QOpcUaEnumField &lhs, const QOpcUaEnumField &rhs)

如果 `lhs ` 不等于 `rhs`,则返回 `true `。

[noexcept] bool operator==(const QOpcUaEnumField &lhs, const QOpcUaEnumField &rhs)

如果 `lhs ` 等于 `rhs`,则返回 `true `。

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