QOpcUaVariant Class
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 |
Public Types
enum class | ValueType { Unknown, Boolean, SByte, Byte, Int16, …, DiagnosticInfo } |
Public Functions
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) |
Related Non-Members
bool | operator!=(const QOpcUaVariant &lhs, const QOpcUaVariant &rhs) |
bool | operator==(const QOpcUaVariant &lhs, const QOpcUaVariant &rhs) |
Detailed Description
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.
Member Type Documentation
enum class QOpcUaVariant::ValueType
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 |
Member Function Documentation
QOpcUaVariant::QOpcUaVariant()
Default constructs a new OPC UA variant.
QOpcUaVariant::QOpcUaVariant(QOpcUaVariant::ValueType type, const QVariant &value)
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.
QOpcUaVariant::QOpcUaVariant(QOpcUaVariant::ValueType type, const QVariant &value, const QList<qint32> arrayDimensions)
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.
QOpcUaVariant::QOpcUaVariant(const QOpcUaVariant &other)
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.
QList<qint32> QOpcUaVariant::arrayDimensions() const
Returns the array dimensions of this OPC UA variant.
See also setArrayDimensions().
bool QOpcUaVariant::isArray() const
Returns true
if this OPC UA variant contains an array value.
void QOpcUaVariant::setArrayDimensions(const QList<qint32> &arrayDimensions)
Sets the array dimensions to arrayDimensions.
See also arrayDimensions().
void QOpcUaVariant::setValue(QOpcUaVariant::ValueType type, const QVariant &value)
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().
void QOpcUaVariant::setValue(QOpcUaVariant::ValueType type, const QVariant &value, const QList<qint32> &arrayDimensions)
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.
QOpcUaVariant::ValueType QOpcUaVariant::type() const
Returns the value type of this OPC UA variant.
QVariant QOpcUaVariant::value() const
Returns the value of this OPC UA variant.
See also setValue().
QVariant QOpcUaVariant::operator QVariant() const
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.
QOpcUaVariant &QOpcUaVariant::operator=(const QOpcUaVariant &rhs)
Sets the values from rhs in this OPC UA variant.
Related Non-Members
[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.
© 2024 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.