[PyQt] SIP Support for wchar_t

Giovanni Bajo rasky at develer.com
Tue Mar 27 10:57:27 BST 2007


On 3/25/2007 4:06 PM, Phil Thompson wrote:

> As of tonight's snapshot SIP has support for wchar_t. There are some issues 
> related to wide strings and the heap - see the documentation for details - 
> which could be partly addressed with some new annotations. I'd prefer that 
> any changes are based on real world examples, so let me have some feedback if 
> you use want to use wchar_t in your own bindings.

... and a bug report: SIP generates a sipFree() call to free the wchar_t 
memory after having used it. It works if the pointer is of type 
"wchar_t*", but it does not work if the pointer is of type "const wchar_t*":

error C2664: 'void (void *)' : cannot convert parameter 1 from 'const 
wchar_t *' to 'void *'
         Conversion loses qualifiers

I worked around it by dropping the const qualifiers from the parameter 
declarations in the SIP files.
-- 
Giovanni Bajo



More information about the PyQt mailing list