En esta página

QOpcUaElementOperand Class

El tipo ElementOperand de OPC UA. Más información...

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

Funciones públicas

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)

Descripción detallada

El ElementOperand se define en la norma OPC UA 1.05, parte 4, apartado 7.7.4.2. Se utiliza para identificar otro elemento del filtro mediante su índice (el primer elemento tiene el índice 0).

Esto es necesario para crear filtros complejos, por ejemplo, para hacer referencia a los dos operandos de la operación AND en ((Severity > 500) AND (Message == "TestString")). El primer paso consiste en crear elementos de filtro de contenido para las dos condiciones (Severity > 500) y (Message == «TestString»). Se necesita un tercer elemento de filtro de contenido para crear una combinación AND de las dos condiciones. Este elemento consta del operador AND y de dos operandos de elemento con los índices de las dos condiciones creadas anteriormente:

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;

Documentación de funciones de miembro

QOpcUaElementOperand::QOpcUaElementOperand()

«Default» crea un operando de tipo elemento sin parámetros definidos.

QOpcUaElementOperand::QOpcUaElementOperand(quint32 index)

Crea un operando de tipo «element» con el índice « index ».

QOpcUaElementOperand::QOpcUaElementOperand(const QOpcUaElementOperand &rhs)

Crea un operando de tipo «element» a partir de « rhs ».

quint32 QOpcUaElementOperand::index() const

Devuelve el índice del elemento del filtro que se va a utilizar como operando.

Véase también setIndex().

void QOpcUaElementOperand::setIndex(quint32 index)

Establece el índice del elemento de filtro que se va a utilizar como operando en index.

Véase también ` index()`.

QOpcUaElementOperand::operator QVariant() const

Convierte este operando de tipo «element» en « QVariant ».

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

Establece los valores de rhs en este operando de elemento.

Elementos no miembros relacionados

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

Devuelve ` true ` si ` lhs ` tiene un valor distinto de ` rhs`.

Esta función se introdujo en Qt 6.7.

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

Devuelve ` true ` si ` lhs ` tiene el mismo valor que ` rhs`.

Esta función se introdujo en 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.