User Guide Cancel

qtvariantwriter | Substance 3D Automation ToolKit

qtvariantwriter

Module qtvariantwriter provides the class QtVariantWriter which allows the serialization of a QVariant object.

class pysbs.qtclasses.qtvariantwriter.QtVariantWriter
class pysbs.qtclasses.qtvariantwriter.QtVariantWriter
 class pysbs.qtclasses.qtvariantwriter.QtVariantWriter  

Bases: object

Class QtVariantWriter allows to write (serialize) a QtVariant object into a Byte Array or a base64 encoded string.

static boolToBytes(aBool)
static boolToBytes(aBool)
 static boolToBytes(aBool)  

Convert the given boolean into in bytes

Parameters:aBool (bool) – The boolean to convert into bytes
Returns:the result of the conversion as a string
static charToBytes(aChar)
static charToBytes(aChar)
 static charToBytes(aChar)  

Convert the given character in bytes

Parameters:aChar (char) – The character to convert into bytes
Returns:the result of the conversion as a string
static doubleToBytes(aDouble)
static doubleToBytes(aDouble)
 static doubleToBytes(aDouble)  

Convert the given double into in bytes

Parameters:aDouble (double) – The double to convert into bytes
Returns:the result of the conversion as a string
static int16ToBytes(aInt)
static int16ToBytes(aInt)
 static int16ToBytes(aInt)  

Convert the given integer into in bytes

Parameters:aInt (integer) – The integer to convert into bytes
Returns:the result of the conversion as a string
static int32ToBytes(aInt)
static int32ToBytes(aInt)
 static int32ToBytes(aInt)  

Convert the given integer into in bytes

Parameters:aInt (integer) – The integer to convert into bytes
Returns:the result of the conversion as a string
static int8ToBytes(aInt)
static int8ToBytes(aInt)
 static int8ToBytes(aInt)  

Convert the given integer into in bytes

Parameters:aInt (integer) – The integer to convert into bytes
Returns:the result of the conversion as a string
toBase64String(aQtVariant)
toBase64String(aQtVariant)
 toBase64String(aQtVariant)  

Write the given QtVariant object into a base64 encoded string.

Parameters:aQtVariant (QtVariant) – The QtVariant object to write in a base64 string
Returns:The base64 encoded string
toByteArrayString(aVariant)
toByteArrayString(aVariant)
 toByteArrayString(aVariant)  

Write the given QtVariant object into a byte array.

Parameters:aQtVariant (QtVariant) – The QtVariant object to write in a ByteArray string
Returns:The bytearray string
writeBool(aBool)
writeBool(aBool)
 writeBool(aBool)  

Write the given Boolean into 1 byte

Parameters:aBool (bool) – The boolean to write
writeByteArray(aByteArray)
writeByteArray(aByteArray)
 writeByteArray(aByteArray)  

Write the given ByteArray with its size

Parameters:aByteArray (ByteArray) – The ByteArray to write
writeChar(aChar)
writeChar(aChar)
 writeChar(aChar)  

Write the given char into 1 byte

Parameters:aChar (char) – The character to write
writeDouble(aDouble)
writeDouble(aDouble)
 writeDouble(aDouble)  

Write the given double into 8 bytes

Parameters:aDouble (double) – The double to write
writeInt(aInt)
writeInt(aInt)
 writeInt(aInt)  

Write the given integer into 4 bytes

Parameters:aInt (integer) – The integer to write
writeInt16(aInt)
writeInt16(aInt)
 writeInt16(aInt)  

Write the given integer into 2 bytes

Parameters:aInt (integer) – The integer to write
writeInt8(aInt)
writeInt8(aInt)
 writeInt8(aInt)  

Write the given integer into 1 byte

Parameters:aInt (integer) – The integer to write
writeQtVariant(aQtVariant)
writeQtVariant(aQtVariant)
 writeQtVariant(aQtVariant)  

Write the given variant item (=type + value)

Parameters:aQtVariant (QtVariant) – The variant object to write
writeQtVariantList(aList)
writeQtVariantList(aList)
 writeQtVariantList(aList)  

Write the given variant list

Parameters:aList (list of QtVariant) – The variant list to write
writeQtVariantMap(aMap)
writeQtVariantMap(aMap)
 writeQtVariantMap(aMap)  

Write the given variant map

Parameters:aMap (QtVariantMap) – The variant map to write
writeQtVariantString(aStr)
writeQtVariantString(aStr)
 writeQtVariantString(aStr)  

Write the given string with its size

Parameters:aStr (str) – The string to write
writeQtVariantValue(aQtVariant)
writeQtVariantValue(aQtVariant)
 writeQtVariantValue(aQtVariant)  

Write the given variant item value, according to the given type

Parameters:aQtVariant (QtVariant) – The object to write
writeSize(aSize)
writeSize(aSize)
 writeSize(aSize)  

Write the given size

Parameters:aSize (tuple of two int) – The size to write
writeString(aStr)
writeString(aStr)
 writeString(aStr)  

Write the given string into 2*len(aStr) bytes

Parameters:aStr (string) – The string to write
writeStringList(aStringList)
writeStringList(aStringList)
 writeStringList(aStringList)  

Write the given string list

Parameters:aStringList (list of string) – The list of strings to write
writeURL(aURL)
writeURL(aURL)
 writeURL(aURL)  

Write the given URL with its size

Parameters:aURL (str) – The url to write

Get help faster and easier

New user?