qtclasses module

Content included in qtclasses module:

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: object

http://pyqt.sourceforge.net/Docs/PyQt4/qvariant.html#QVariantList-typedef

class qtclasses.qtclasses.QtVariant(aType=None, aValue=None)

Bases: object

Class QtVariant provides the definition of a variant object.

Members
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: object

Class 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: object

Class 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: object

Color 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