[PyQt] Accessing global variables

Marco Meier marco.meier at ifak.eu
Fri Aug 24 13:26:10 BST 2012


Hi,

i am trying to access an enum that is defined globally in a namespace.
Simply defining it in the sip file wraps the type correctly, but the
value is not the one in the c++ shared object.

I tried to use %SetCode and %GetCode with an integer to access the
correct value. %GetCode works as intended. But when setting the value
e.g. with module.enuminstance = 2, the %SetCode is not called, but a new
integer object is assigned to module.enuminstance. What is the correct
way to modify this global enum?

Thanks,

Marco


More information about the PyQt mailing list