The OPC UA Variant. More...
| Header: | #include <QOpcUaVariant> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS OpcUa)target_link_libraries(mytarget PRIVATE Qt6::OpcUa) |
| qmake: | QT += opcua |
| Since: | Qt 6.7 |
| enum class | ValueType { Unknown, Boolean, SByte, Byte, Int16, …, DiagnosticInfo } |
| QOpcUaVariant() | |
| QOpcUaVariant(QOpcUaVariant::ValueType type, const QVariant &value) | |
| QOpcUaVariant(QOpcUaVariant::ValueType type, const QVariant &value, const QList<qint32> arrayDimensions) | |
| QOpcUaVariant(const QOpcUaVariant &other) | |
| QOpcUaVariant(QOpcUaVariant &&other) | |
| ~QOpcUaVariant() | |
| QList<qint32> | arrayDimensions() const |
| bool | isArray() const |
| void | setArrayDimensions(const QList<qint32> &arrayDimensions) |
| void | setValue(QOpcUaVariant::ValueType type, const QVariant &value) |
| void | setValue(QOpcUaVariant::ValueType type, const QVariant &value, const QList<qint32> &arrayDimensions) |
| void | swap(QOpcUaVariant &other) |
| QOpcUaVariant::ValueType | type() const |
| QVariant | value() const |
| QVariant | operator QVariant() const |
| QOpcUaVariant & | operator=(QOpcUaVariant &&other) |
| QOpcUaVariant & | operator=(const QOpcUaVariant &rhs) |
| bool | operator!=(const QOpcUaVariant &lhs, const QOpcUaVariant &rhs) |
| bool | operator==(const QOpcUaVariant &lhs, const QOpcUaVariant &rhs) |
The OPC UA variant is an union of all built-in OPC UA types and also contains information about the array dimensions associated with the value. This class is currently only supported by QOpcUaBinaryDataEncoding and QOpcUaGenericStructHandler.
This enum contains the possible value types of an OPC UA variant.
| Constant | Value | Description |
|---|---|---|
QOpcUaVariant::ValueType::Unknown |
0 |
|
QOpcUaVariant::ValueType::Boolean |
1 |
|
QOpcUaVariant::ValueType::SByte |
2 |
|
QOpcUaVariant::ValueType::Byte |
3 |
|
QOpcUaVariant::ValueType::Int16 |
4 |
|
QOpcUaVariant::ValueType::UInt16 |
5 |
|
QOpcUaVariant::ValueType::Int32 |
6 |
|
QOpcUaVariant::ValueType::UInt32 |
7 |
, |
QOpcUaVariant::ValueType::Int64 |
8 |
|
QOpcUaVariant::ValueType::UInt64 |
9 |
|
QOpcUaVariant::ValueType::Float |
10 |
|
QOpcUaVariant::ValueType::Double |
11 |
|
QOpcUaVariant::ValueType::String |
12 |
|
QOpcUaVariant::ValueType::DateTime |
13 |
|
QOpcUaVariant::ValueType::Guid |
14 |
|
QOpcUaVariant::ValueType::ByteString |
15 |
|
QOpcUaVariant::ValueType::XmlElement |
16 |
|
QOpcUaVariant::ValueType::NodeId |
17 |
|
QOpcUaVariant::ValueType::ExpandedNodeId |
18 |
|
QOpcUaVariant::ValueType::StatusCode |
19 |
|
QOpcUaVariant::ValueType::QualifiedName |
20 |
|
QOpcUaVariant::ValueType::LocalizedText |
21 |
|
QOpcUaVariant::ValueType::ExtensionObject |
22 |
|
QOpcUaVariant::ValueType::DataValue |
23 |
|
QOpcUaVariant::ValueType::Variant |
24 |
|
QOpcUaVariant::ValueType::DiagnosticInfo |
25 |
Default constructs a new OPC UA variant.
Constructs a new OPC UA variant of type type with value value.
Scalar values must be passed as a QVariant containing a value of type. Array values must be passed as a QVariant containing a QList of type.
Constructs a new OPC UA variant of type type with value value and array dimensions arrayDimensions.
Scalar values must be passed as a QVariant containing a value of type. Array values must be passed as a QVariant containing a QList of type.
Constructs a new OPC UA variant from other.
[noexcept] QOpcUaVariant::QOpcUaVariant(QOpcUaVariant &&other)Move-constructs a new OPC UA variant from other.
Note: The moved-from object other is placed in a partially-formed state, in which the only valid operations are destruction and assignment of a new value.
[noexcept] QOpcUaVariant::~QOpcUaVariant()Destroys this OPC UA variant.
Returns the array dimensions of this OPC UA variant.
See also setArrayDimensions().
Returns true if this OPC UA variant contains an array value.
Sets the array dimensions to arrayDimensions.
See also arrayDimensions().
Sets the value of this OPC UA variant to value and the type to type.
Scalar values must be passed as a QVariant containing a value of type. Array values must be passed as a QVariant containing a QList of type.
See also value().
Sets the value of this OPC UA variant to value, the type to type and the array dimensions to arrayDimensions.
Scalar values must be passed as a QVariant containing a value of type. Array values must be passed as a QVariant containing a QList of type.
[noexcept] void QOpcUaVariant::swap(QOpcUaVariant &other)Swaps enum definition object other with this OPC UA variant object. This operation is very fast and never fails.
Returns the value type of this OPC UA variant.
Returns the value of this OPC UA variant.
See also setValue().
Returns a QVariant containing this OPC UA variant.
[noexcept] QOpcUaVariant
&QOpcUaVariant::operator=(QOpcUaVariant &&other)Move-assigns other to this QOpcUaVariant instance.
Note: The moved-from object other is placed in a partially-formed state, in which the only valid operations are destruction and assignment of a new value.
Sets the values from rhs in this OPC UA variant.
[noexcept] bool operator!=(const QOpcUaVariant &lhs, const QOpcUaVariant &rhs)Returns true if lhs is not equal to rhs.
[noexcept] bool operator==(const QOpcUaVariant &lhs, const QOpcUaVariant &rhs)Returns true if lhs is equal to rhs.