このページでは

QOpcUaElementOperand Class

OPC UA の ElementOperand 型。詳細...

ヘッダー: #include <QOpcUaElementOperand>
CMake: find_package(Qt6 REQUIRED COMPONENTS OpcUa)
target_link_libraries(mytarget PRIVATE Qt6::OpcUa)
qmake: QT += opcua

パブリック関数

QOpcUaElementOperand()
QOpcUaElementOperand(quint32 index)
QOpcUaElementOperand(const QOpcUaElementOperand &rhs)
quint32 index() const
void setIndex(quint32 index)
operator QVariant() const
QOpcUaElementOperand &operator=(const QOpcUaElementOperand &rhs)
(since 6.7) bool operator!=(const QOpcUaElementOperand &lhs, const QOpcUaElementOperand &rhs)
(since 6.7) bool operator==(const QOpcUaElementOperand &lhs, const QOpcUaElementOperand &rhs)

詳細な説明

ElementOperand は、OPC UA 1.05 パート 4 の 7.7.4.2 で定義されています。これは、インデックス(最初の要素のインデックスは 0)によって、フィルタ内の別の要素を識別するために使用されます。

これは、例えば ((Severity > 500) AND (Message == "TestString")) における AND 演算の 2 つのオペランドを参照するなど、複雑なフィルターを作成するために必要です。 まず、2 つの条件(Severity > 500)および(Message == "TestString")に対するコンテンツ・フィルタ・エレメントを作成します。これら 2 つの条件を AND 演算で組み合わせるには、3 つ目のコンテンツ・フィルタ・エレメントが必要です。これは、AND 演算子と、先に作成した 2 つの条件のインデックスを持つ 2 つの要素オペランドで構成されます。

QOpcUaMonitoringParameters::EventFilter filter;
...
// setup select clauses
...
QOpcUaContentFilterElement condition1;
QOpcUaContentFilterElement condition2;
QOpcUaContentFilterElement condition3;
condition1 << QOpcUaContentFilterElement::FilterOperator::GreaterThan << QOpcUaSimpleAttributeOperand("Severity") <<
                QOpcUaLiteralOperand(quint16(500), QOpcUa::Types::UInt16);
condition2 << QOpcUaContentFilterElement::FilterOperator::Equals << QOpcUaSimpleAttributeOperand("Message") <<
                QOpcUaLiteralOperand("TestString", QOpcUa::Types::String);
condition3 << QOpcUaContentFilterElement::FilterOperator::And << QOpcUaElementOperand(0) << QOpcUaElementOperand(1);
filter << condition1 << condition2 << condition3;

メンバー関数のドキュメント

QOpcUaElementOperand::QOpcUaElementOperand()

default は、パラメータが設定されていない要素オペランドを生成します。

QOpcUaElementOperand::QOpcUaElementOperand(quint32 index)

インデックスindex を持つ要素オペランドを構築します。

QOpcUaElementOperand::QOpcUaElementOperand(const QOpcUaElementOperand &rhs)

rhs から要素オペランドを生成します。

quint32 QOpcUaElementOperand::index() const

オペランドとして使用されるフィルタ要素のインデックスを返します。

setIndex()も参照してください 。

void QOpcUaElementOperand::setIndex(quint32 index)

index のオペランドとして使用されるフィルタ要素のインデックスを設定します。

index()も参照してください 。

QOpcUaElementOperand::operator QVariant() const

この要素オペランドをQVariant に変換します。

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

この要素オペランドに、rhs の値を設定します。

関連する非メンバー

[noexcept, since 6.7] bool operator!=(const QOpcUaElementOperand &lhs, const QOpcUaElementOperand &rhs)

lhs がrhs と異なる値である場合、true を返します。

この関数は Qt 6.7 で導入されました。

[noexcept, since 6.7] bool operator==(const QOpcUaElementOperand &lhs, const QOpcUaElementOperand &rhs)

lhs の値がrhs と同じ場合、true を返します。

この関数は Qt 6.7 で導入されました。

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