PySide6.QtOpcUa.QOpcUaVariant¶
- class QOpcUaVariant¶
- The OPC UA Variant. More… - Added in version 6.7. - Synopsis¶- Methods¶- def - __init__()
- def - isArray()
- def - __ne__()
- def - __eq__()
- def - setValue()
- def - swap()
- def - type()
- def - value()
 - 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 - QOpcUaBinaryDataEncodingand- 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:
- other – - QOpcUaVariant
 
 - Constructs a new OPC UA variant from - other.- __init__(type, value)
- Parameters:
- type – - ValueType
- value – object 
 
 
 - Constructs a new OPC UA variant of type - typewith 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:
- type – - ValueType
- value – object 
- arrayDimensions – .list of qint32 
 
 
 - Constructs a new OPC UA variant of type - typewith value- valueand 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. - See also - isArray()¶
- Return type:
- bool 
 
 - Returns - trueif this OPC UA variant contains an array value.- __ne__(rhs)¶
- Parameters:
- rhs – - QOpcUaVariant
- Return type:
- bool 
 
 - Returns - trueif- lhsis not equal to- rhs.- __eq__(rhs)¶
- Parameters:
- rhs – - QOpcUaVariant
- Return type:
- bool 
 
 - Returns - trueif- lhsis equal to- rhs.- setArrayDimensions(arrayDimensions)¶
- Parameters:
- arrayDimensions – .list of qint32 
 
 - Sets the array dimensions to - arrayDimensions.- See also - Sets the value of this OPC UA variant to - valueand 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 - setValue(type, value, arrayDimensions)
- Parameters:
- type – - ValueType
- value – object 
- arrayDimensions – .list of qint32 
 
 
 - Sets the value of this OPC UA variant to - value, the type to- typeand 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:
- other – - QOpcUaVariant
 
 - Swaps enum definition object - otherwith this OPC UA variant object. This operation is very fast and never fails.- Returns the value type of this OPC UA variant. - value()¶
- Return type:
- object 
 
 - Returns the value of this OPC UA variant. - See also