class QOpcUaVariant

The OPC UA Variant. More

Added in version 6.7.

Synopsis

Methods

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

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 .

class ValueType

This enum contains the possible value types of an OPC UA variant.

Constant

Description

QOpcUaVariant.ValueType.Unknown

QOpcUaVariant.ValueType.Boolean

QOpcUaVariant.ValueType.SByte

QOpcUaVariant.ValueType.Byte

QOpcUaVariant.ValueType.Int16

QOpcUaVariant.ValueType.UInt16

QOpcUaVariant.ValueType.Int32

QOpcUaVariant.ValueType.UInt32

,

QOpcUaVariant.ValueType.Int64

QOpcUaVariant.ValueType.UInt64

QOpcUaVariant.ValueType.Float

QOpcUaVariant.ValueType.Double

QOpcUaVariant.ValueType.String

QOpcUaVariant.ValueType.DateTime

QOpcUaVariant.ValueType.Guid

QOpcUaVariant.ValueType.ByteString

QOpcUaVariant.ValueType.XmlElement

QOpcUaVariant.ValueType.NodeId

QOpcUaVariant.ValueType.ExpandedNodeId

QOpcUaVariant.ValueType.StatusCode

QOpcUaVariant.ValueType.QualifiedName

QOpcUaVariant.ValueType.LocalizedText

QOpcUaVariant.ValueType.ExtensionObject

QOpcUaVariant.ValueType.DataValue

QOpcUaVariant.ValueType.Variant

QOpcUaVariant.ValueType.DiagnosticInfo

__init__()

Default constructs a new OPC UA variant.

__init__(other)
Parameters:

otherQOpcUaVariant

Constructs a new OPC UA variant from other.

__init__(type, value)
Parameters:

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.

__init__(type, value, arrayDimensions)
Parameters:
  • typeValueType

  • value – object

  • arrayDimensions – .list of qint32

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.

arrayDimensions()
Return type:

.list of qint32

Returns the array dimensions of this OPC UA variant.

isArray()
Return type:

bool

Returns true if this OPC UA variant contains an array value.

__ne__(rhs)
Parameters:

rhsQOpcUaVariant

Return type:

bool

Returns true if lhs is not equal to rhs.

__eq__(rhs)
Parameters:

rhsQOpcUaVariant

Return type:

bool

Returns true if lhs is equal to rhs.

setArrayDimensions(arrayDimensions)
Parameters:

arrayDimensions – .list of qint32

Sets the array dimensions to arrayDimensions.

setValue(type, value)
Parameters:

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()

setValue(type, value, arrayDimensions)
Parameters:
  • typeValueType

  • value – object

  • arrayDimensions – .list of qint32

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.

swap(other)
Parameters:

otherQOpcUaVariant

Swaps enum definition object other with this OPC UA variant object. This operation is very fast and never fails.

type()
Return type:

ValueType

Returns the value type of this OPC UA variant.

value()
Return type:

object

Returns the value of this OPC UA variant.

See also

setValue()