In questa pagina

QOpcUaElementOperand Class

Il tipo ElementOperand di OPC UA. Maggiori informazioni...

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

Funzioni pubbliche

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)

Descrizione dettagliata

L'ElementOperand è definito nella specifica OPC UA 1.05, parte 4, sezione 7.7.4.2. Viene utilizzato per identificare un altro elemento nel filtro tramite il suo indice (il primo elemento ha indice 0).

Ciò è necessario per creare filtri complessi, ad esempio per fare riferimento ai due operandi dell'operazione AND in ((Severity > 500) AND (Message == "TestString")). Il primo passo consiste nel creare elementi di filtro di contenuto per le due condizioni (Severity > 500) e (Message == "TestString"). È necessario un terzo elemento di filtro di contenuto per creare una combinazione AND delle due condizioni. Esso è costituito dall’operatore AND e da due operandi di elemento con gli indici delle due condizioni create in precedenza:

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;

Documentazione delle funzioni membro

QOpcUaElementOperand::QOpcUaElementOperand()

Il valore predefinito crea un operando di tipo elemento senza parametri specificati.

QOpcUaElementOperand::QOpcUaElementOperand(quint32 index)

Crea un operando di tipo elemento con indice index.

QOpcUaElementOperand::QOpcUaElementOperand(const QOpcUaElementOperand &rhs)

Crea un operando di tipo elemento a partire da rhs.

quint32 QOpcUaElementOperand::index() const

Restituisce l'indice dell'elemento del filtro che verrà utilizzato come operando.

Vedi anche setIndex().

void QOpcUaElementOperand::setIndex(quint32 index)

Imposta l'indice dell'elemento di filtro che verrà utilizzato come operando per la funzione index.

Vedi anche ` index()`.

QOpcUaElementOperand::operator QVariant() const

Converte l'operando di questo elemento in un QVariant.

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

Imposta i valori provenienti da rhs in questo operando elemento.

Elementi non membri correlati

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

Restituisce ` true ` se ` lhs ` ha un valore diverso da ` rhs`.

Questa funzione è stata introdotta in Qt 6.7.

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

Restituisce ` true ` se ` lhs ` ha lo stesso valore di ` rhs`.

Questa funzione è stata introdotta in 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.