QElementOperand Class


The OPC UA ElementOperand type. More...

Header: #include <QtOpcUa/qopcuatype.h>
qmake: QT += opcua

Public Functions

QElementOperand(const QOpcUa::QElementOperand &rhs)
QElementOperand(quint32 index)
quint32 index() const
void setIndex(quint32 index)
QVariant operator QVariant() const
QOpcUa::QElementOperand &operator=(const QOpcUa::QElementOperand &rhs)

Detailed Description

The OPC UA ElementOperand type.

The ElementOperand is defined in OPC-UA part 4, It is used to identify another element in the filter by its index (the first element has the index 0).

This is required to create complex filters, for example to reference the two operands of the AND operation in ((Severity > 500) AND (Message == "TestString")). The first step is to create content filter elements for the two conditions (Severity > 500) and (Message == "TestString"). A third content filter element is required to create an AND combination of the two conditions. It consists of the AND operator and two element operands with the indices of the two conditions created before:

QOpcUaMonitoringParameters::EventFilter filter;
// setup select clauses
QOpcUa::QContentFilterElement condition1;
QOpcUa::QContentFilterElement condition2;
QOpcUa::QContentFilterElement condition3;
condition1 << QOpcUa::QContentFilterElement::FilterOperator::GreaterThan << QOpcUa::QSimpleAttributeOperand("Severity") <<
                QOpcUa::QLiteralOperand(quint16(500), QOpcUa::Types::UInt16);
condition2 << QOpcUa::QContentFilterElement::FilterOperator::Equals << QOpcUa::QSimpleAttributeOperand("Message") <<
                QOpcUa::QLiteralOperand("TestString", QOpcUa::Types::String);
condition3 << QOpcUa::QContentFilterElement::FilterOperator::And << QOpcUa::QElementOperand(0) << QOpcUa::QElementOperand(1);
filter << condition1 << condition2 << condition3;

Member Function Documentation


Default constructs an instance of QElementOperand.

QElementOperand::QElementOperand(const QOpcUa::QElementOperand &rhs)

Constructs an element operand from rhs.

QElementOperand::QElementOperand(quint32 index)

Constructs an element operand with index index.


Destroys the instance of QElementOperand.

quint32 QElementOperand::index() const

Returns the index of the filter element that is going to be used as operand.

See also setIndex().

void QElementOperand::setIndex(quint32 index)

Sets the index of the filter element that is going to be used as operand to index.

See also index().

QVariant QElementOperand::operator QVariant() const

Converts this element operand to QVariant.

QOpcUa::QElementOperand &QElementOperand::operator=(const QOpcUa::QElementOperand &rhs)

Sets the values from rhs in this element operand.

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