[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] property support?
From:       "Diez B. Roggisch" <deets () web ! de>
Date:       2007-08-17 17:33:02
Message-ID: 46C5DBCE.7000909 () web ! de
[Download RAW message or body]

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
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic