[PyQt] property support?

Diez B. Roggisch deets at web.de
Fri Aug 17 18:33:02 BST 2007


Phil Thompson schrieb:
> On Friday 17 August 2007, Diez B. Roggisch wrote:
>> Hi,
>>
>> is there any existing or planned property-support? I've got a class that
>> essentially looks like this:
>>
>> class Foo {
>> public:
>>     SomeType Name[Size];
>> };
>>
>>
>> So the Name-property is part of the public API. I'd like to access that
>> using
>>
>> foo_instance.Name
>>
>> instead of introducing a getter/setter-pair. Any suggestions?
> 
> http://www.riverbankcomputing.com/Docs/sip4/sipref.html#getcode

Great. I searched the docs for "property", but that wasn't mentioned 
around %GetCode/%SetCode.

However utilizing it, I stumbled over the following error:

sip: irr::video::SMaterial::TextureWrap has an unsupported type


The declaration looks like this (for now I don't care about setting, but 
I stubbed it to make sure that's not the problem cause)

       //! Texture Clamp Mode
       irr::video::E_TEXTURE_CLAMP *TextureWrap;
%GetCode
if(sipCpp && *sipCpp) {
   sipPy = PyTuple_New(MATERIAL_MAX_TEXTURES);
   irr::video::E_TEXTURE_CLAMP *tw = *(irr::video::E_TEXTURE_CLAMP 
**)sipCpp;
   const enumType *sipFindMappedType("irr::video::E_TEXTURE_CLAMP");
   for(int i = 0; i < MATERIAL_MAX_TEXTURES; i++) {
     PyTuple_SetItem(sipPy, sipConvertFromNamedEnum(tw[i], enumType));
   }
  } else {
   sipPy = Py_None;
  }
%End
%SetCode
sipCpp = 0;
%End


E_TEXTUR_CLAMP is your run-off-the-mill enumeration type. Any 
suggestions why that fails?

Regard,s

Diez


More information about the PyQt mailing list