class QOpcUaVariant#

The OPC UA Variant. More

New 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__(value, type[, isArray=false[, arrayDimensions={}]])
Parameters:
  • value – object

  • typeValueType

  • isArray – bool

  • arrayDimensions – .list of qint32

Constructs a new OPC UA variant and sets value, type, isArray and arrayDimensions

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.

setValue(value, type[, isArray=false[, arrayDimensions={}]])#
Parameters:
  • value – object

  • typeValueType

  • isArray – bool

  • arrayDimensions – .list of qint32

Sets the value of this OPC UA variant to value, the type to type, isArray to isArray and the array dimensions to arrayDimensions.

Array values must be passed as a QList of type.

See also

value()

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