qtclasses module
Content included in qtclasses module:
- qtvariantreader module: Defininition of the class QtVariantReader
QtVariantReaderQtVariantReader.bytesToBool()QtVariantReader.bytesToChar()QtVariantReader.bytesToInt()QtVariantReader.bytesToInt16()QtVariantReader.bytesToInt8()QtVariantReader.getFromBase64String()QtVariantReader.getFromByteArray()QtVariantReader.readBool()QtVariantReader.readByteArray()QtVariantReader.readChar()QtVariantReader.readDouble()QtVariantReader.readInt()QtVariantReader.readInt16()QtVariantReader.readInt8()QtVariantReader.readKey()QtVariantReader.readQtVariant()QtVariantReader.readQtVariantList()QtVariantReader.readQtVariantMap()QtVariantReader.readQtVariantString()QtVariantReader.readQtVariantValue()QtVariantReader.readSize()QtVariantReader.readString()QtVariantReader.readStringList()QtVariantReader.readURL()
- qtvariantwriter module: Defininition of the class QtVariantWriter
QtVariantWriterQtVariantWriter.boolToBytes()QtVariantWriter.charToBytes()QtVariantWriter.doubleToBytes()QtVariantWriter.int16ToBytes()QtVariantWriter.int32ToBytes()QtVariantWriter.int8ToBytes()QtVariantWriter.toBase64String()QtVariantWriter.toByteArrayString()QtVariantWriter.writeBool()QtVariantWriter.writeByteArray()QtVariantWriter.writeChar()QtVariantWriter.writeDouble()QtVariantWriter.writeInt()QtVariantWriter.writeInt16()QtVariantWriter.writeInt8()QtVariantWriter.writeQtVariant()QtVariantWriter.writeQtVariantList()QtVariantWriter.writeQtVariantMap()QtVariantWriter.writeQtVariantString()QtVariantWriter.writeQtVariantValue()QtVariantWriter.writeSize()QtVariantWriter.writeString()QtVariantWriter.writeStringList()QtVariantWriter.writeURL()
Module qtclasses provides an implementation of a very small subset of classes present in PyQt API, in particular the QVariant object, in order to handle the objects serialized in the .sbs file from a Qt object, as it is the case for the Baking Parameters.
- class qtclasses.qtclasses.QtVariantTypeEnum
Bases:
objecthttp://pyqt.sourceforge.net/Docs/PyQt4/qvariant.html#QVariantList-typedef
- class qtclasses.qtclasses.QtVariant(aType=None, aValue=None)
Bases:
objectClass QtVariant provides the definition of a variant object.
- Members
mType (
QtVariantTypeEnum): type of the variant objectmValue (any type): value
- getValue()
Get the value of the variant object
- Returns:
The value of the variant object
- getValueStr()
Get the value of the variant object converted into a string
- Returns:
The value of the variant object, as a string
- setValue(aValue)
Set the value of the variant object, without modifying its type.
- Parameters:
aValue (any type compatible with the current type of the variant object) – The value to set
- Raise:
TypeError if the type of the value is incompatible with the type of the variant object
- class qtclasses.qtclasses.QtVariantMap(aMap)
Bases:
objectClass QtVariantMap provides the definition of a variant map, which has a dictionary associating a key to a
QtVariant.- Members
mMap (dictionary with the format {key(str):value(
QtVariant)}: the dictionary of variant objects.
- getItem(aKey)
Get the variant object of the given key in the map
- Parameters:
aKey (str) – The key to look for
- Returns:
The variant object with this key if found, None otherwise
- getItemValue(aKey)
Get the value of the given key in the map
- Parameters:
aKey (str) – The key to look for
- Returns:
The value of the variant object with this key if found, None otherwise
- getSize()
Get the size of the map
- Returns:
The size of the map as an integer
- setItem(aKey, aValue)
Set the given item with the given key
- Parameters:
aKey (str) – The key to add
aValue (
QtVariant) – The item to set
- Returns:
The size of the map as an integer
- pop(aKey, aDefault)
Remove the item at the given key and return it.
- Parameters:
aKey (str) – The key to remove
aDefault (any type) – The default value to return if not found
- Returns:
The item removed if found, of the given default value if not found
- class qtclasses.qtclasses.QtColor(aMode=1, aAlpha=0, aC1=0, aC2=0, aC3=0, aC4=0)
Bases:
objectClass QtColor provides the definition of a color.
- Members
mMode (
QtColorModeEnum)}: the color mode.mAlpha (int): Alpha component value
mC1 (int): First component value
mC2 (int): Second component value
mC3 (int): Third component value
mC4 (int): Fourth component value
- class QtColorModeEnum
Bases:
objectColor mode enumeration
- getColor()
Get the color in the appropriate format depending on the color mode (RGB or HSV)
- Returns:
The color as a list of 4 int [R,G,B,A] or [H,S,V,A]
- isRGBA()
Check if the color is defined as an RGBA color
- Returns:
True if RGBA, False otherwise
- isHSVA()
Check if the color is defined as an HSVA color
- Returns:
True if HSVA, False otherwise
- setColorRGBA(aColorRGBA)
Set the RGBA color with the provided values. R, G, B, and A component must be in the range [0;255]
- Parameters:
aColorRGBA (list of 4 int in the range [0;255]) – The RGBA color to set
- Returns:
nothing
- setColorHSVA(aColorHSVA)
Set the HSV and Alpha color with the provided values. H component must be in the range [0;359] S, V, and A component must be in the range [0;255]
- Parameters:
aColorHSVA (list of 4 int. H in the range [0;359], S, V and A in the range [0;255]) – The HSVA color to set
- Returns:
nothing