本页内容

QOpcUaStructureField Class

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

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

公共函数

QOpcUaStructureField(qint32 valueRank = -1)
QOpcUaStructureField(const QOpcUaStructureField &other)
QOpcUaStructureField(QOpcUaStructureField &&other)
~QOpcUaStructureField()
QList<quint32> arrayDimensions() const
QString dataType() const
QOpcUaLocalizedText description() const
bool isOptional() const
quint32 maxStringLength() const
QString name() const
void setArrayDimensions(const QList<quint32> &arrayDimensions)
void setDataType(const QString &dataTypeId)
void setDescription(const QOpcUaLocalizedText &description)
void setIsOptional(bool isOptional)
void setMaxStringLength(quint32 maxStringLength)
void setName(const QString &name)
void setValueRank(qint32 valueRank)
void swap(QOpcUaStructureField &other)
qint32 valueRank() const
operator QVariant() const
QOpcUaStructureField &operator=(QOpcUaStructureField &&other)
QOpcUaStructureField &operator=(const QOpcUaStructureField &other)
bool operator!=(const QOpcUaStructureField &lhs, const QOpcUaStructureField &rhs)
bool operator==(const QOpcUaStructureField &lhs, const QOpcUaStructureField &rhs)

详细描述

这是 OPC UA 第 3 部分中定义的 OPC UA StructureField 类型的Qt OPC UA 表示形式。它描述了结构化类型的一个字段。

成员函数文档

[explicit] QOpcUaStructureField::QOpcUaStructureField(qint32 valueRank = -1)

使用valueRank 构建一个结构字段。

QOpcUaStructureField::QOpcUaStructureField(const QOpcUaStructureField &other)

根据other 构建一个结构字段。

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

从 `other` 创建一个新的结构体字段。

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

[noexcept] QOpcUaStructureField::~QOpcUaStructureField()

销毁此结构字段对象。

QList<quint32> QOpcUaStructureField::arrayDimensions() const

返回结构体字段的数组维度。

另请参阅 setArrayDimensions()。

QString QOpcUaStructureField::dataType() const

返回结构体字段的数据类型节点 ID。

另请参阅 setDataType()。

QOpcUaLocalizedText QOpcUaStructureField::description() const

返回结构体字段的描述。

另请参阅 setDescription()。

bool QOpcUaStructureField::isOptional() const

如果结构体字段是可选的,则返回true 。

另请参阅 setIsOptional()。

quint32 QOpcUaStructureField::maxStringLength() const

返回该结构体字段的字符串最大长度。

另请参阅 setMaxStringLength()。

QString QOpcUaStructureField::name() const

返回结构体字段的名称。

另请参阅 setName()。

void QOpcUaStructureField::setArrayDimensions(const QList<quint32> &arrayDimensions)

将结构体字段的数组维度设置为arrayDimensions 。

另请参阅 arrayDimensions()。

void QOpcUaStructureField::setDataType(const QString &dataTypeId)

将结构体字段的数据类型节点 ID 设置为dataTypeId 。

另请参阅 dataType()。

void QOpcUaStructureField::setDescription(const QOpcUaLocalizedText &description)

将结构体字段的描述设置为description 。

另请参阅 description()。

void QOpcUaStructureField::setIsOptional(bool isOptional)

将结构体字段的可选标志设置为isOptional 。

另请参阅 isOptional()。

void QOpcUaStructureField::setMaxStringLength(quint32 maxStringLength)

将结构体字段的最大字符串长度设置为maxStringLength 。

另请参阅 maxStringLength()。

void QOpcUaStructureField::setName(const QString &name)

将结构体字段的名称设置为name 。

另请参阅 name()。

void QOpcUaStructureField::setValueRank(qint32 valueRank)

将结构体字段的值等级设置为valueRank 。

另请参阅 valueRank()。

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

将结构字段对象other 与该结构字段对象进行交换。此操作速度极快,且绝不会失败。

qint32 QOpcUaStructureField::valueRank() const

返回该结构体字段的值 rank。

另请参阅 setValueRank()。

QOpcUaStructureField::operator QVariant() const

将此结构字段转换为QVariant 。

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

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

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

QOpcUaStructureField &QOpcUaStructureField::operator=(const QOpcUaStructureField &other)

将other 中的值设置到此结构字段中。

相关的非成员

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

返回结果为:true ,lhs 不等于rhs 。

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

返回true ,其中lhs 等于rhs 。

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