User Guide Cancel

qtvariantreader | Substance 3D Automation ToolKit

qtvariantreader

Module qtvariantreader provides the class QtVariantReader which allows the deserialization of a QVariant object.

class pysbs.qtclasses.qtvariantreader.QtVariantReader
class pysbs.qtclasses.qtvariantreader.QtVariantReader
 class pysbs.qtclasses.qtvariantreader.QtVariantReader  

Bases: object

Class QtVariantReader allows to read (deserialize) a QtVariant object from a Byte Array or a base64 encoded string.

static bytesToBool(aStr)
static bytesToBool(aStr)
 static bytesToBool(aStr)  

Convert the given string in hexadecimal into a bool

Parameters:aStr (bytes) – The string to convert
Returns:The result of the conversion as a bool
static bytesToChar(aStr)
static bytesToChar(aStr)
 static bytesToChar(aStr)  

Convert the given string in hexadecimal into a char

Parameters:aStr (bytes) – The string to convert
Returns:The result of the conversion as a char
static bytesToInt(aStr)
static bytesToInt(aStr)
 static bytesToInt(aStr)  

Convert the given string in hexadecimal into an integer

Parameters:aStr (bytes) – The string to convert
Returns:The result of the conversion as an integer
static bytesToInt16(aStr)
static bytesToInt16(aStr)
 static bytesToInt16(aStr)  

Convert the given string in hexadecimal into an integer

Parameters:aStr (bytes) – The string to convert
Returns:The result of the conversion as an integer
static bytesToInt8(aStr)
static bytesToInt8(aStr)
 static bytesToInt8(aStr)  

Convert the given string in hexadecimal into an integer

Parameters:aStr (bytes) – The string to convert
Returns:The result of the conversion as an integer
getFromBase64String(aEncodedString, aType)
getFromBase64String(aEncodedString, aType)
 getFromBase64String(aEncodedString, aType)  

Read the given base64 encoded string and return the included QtVariant which must be of the given type

Parameters:
  • aEncodedString (str) – The string to read
  • aType (QtVariantTypeEnum) – Type of the QtVariant included in the byte array
Returns:

The QtVariant object

getFromByteArray(aByteArray, aType)
getFromByteArray(aByteArray, aType)
 getFromByteArray(aByteArray, aType)  

Read the given byte array and return the included QtVariant which must be of the given type

Parameters:
  • aByteArray (bytearray or str) – The byte array to read
  • aType (QtVariantTypeEnum) – Type of the QtVariant included in the byte array
Returns:

The QtVariant object

readBool()
readBool()
 readBool()  

Read 1 bytes as a Boolean

Returns:The next boolean as a Boolean
readByteArray()
readByteArray()
 readByteArray()  

Read the next ByteArray

Returns:The ByteArray as a String
readChar()
readChar()
 readChar()  

Read 1 bytes as a char

Returns:The next character as a string
readDouble()
readDouble()
 readDouble()  

Read 8 bytes as a double

Returns:The next double as an Double
readInt()
readInt()
 readInt()  

Read 4 bytes as an integer

Returns:The next integer as an Integer
readInt16()
readInt16()
 readInt16()  

Read 2 bytes as an integer

Returns:The next integer as an Integer
readInt8()
readInt8()
 readInt8()  

Read 1 byte as an integer

Returns:The next integer as an Integer
readKey()
readKey()
 readKey()  

Read the next key (=size of the key + string)

Returns:The key as a String
readQtVariant()
readQtVariant()
 readQtVariant()  

Read the next variant item (=type + value)

Returns:The variant item as a QtVariant
readQtVariantList()
readQtVariantList()
 readQtVariantList()  

Read the next variant list

Returns:The variant map as a list of QtVariant
readQtVariantMap()
readQtVariantMap()
 readQtVariantMap()  

Read the next variant map

Returns:The variant map as a dictionary of QtVariant
readQtVariantString()
readQtVariantString()
 readQtVariantString()  

Read the next string

Returns:The bytes as a String
readQtVariantValue()
readQtVariantValue()
 readQtVariantValue()  

Read the next variant item value, according to the given type

Returns:The variant item as a QtVariant
readSize()
readSize()
 readSize()  

Read the next size object

Returns:The size as a tuple(int width,int height)
readString()
readString()
 readString()  

Read aSize bytes as a string

Returns:The bytes as a String
readStringList()
readStringList()
 readStringList()  

Read the next string list

Returns:The string map as a list of string
readURL()
readURL()
 readURL()  

Read the next URL

Returns:The url as a string

Get help faster and easier

New user?