[PyQt] Error when converting QVariant back to Python object

Baz Walter bazwal at ftml.net
Sat May 29 17:37:49 BST 2010


On 29/05/10 10:00, Phil Thompson wrote:
> Fixed in the current PyQt snapshot - sort of. It assumes that the char *
> refers to a '\0' terminated string, which may not be the case.
>
> Although earlier versions didn't seem to crash, I don't think they worked
> any better.

thanks phil

i've tried the new pyqt snapshot with the latest qscintilla snapshot. i 
tested all the scintilla notifications that send char * (SCN_MODIFIED, 
SCN_USERLISTSELECTION and SCN_AUTOCSELECTION) and none of them now 
produce errors or crashes.

however, none of the actual string values sent are usable: 
SCN_USERLISTSELECTION gives an empty string, and the other two just garbage.

i also tried SCN_MACRORECORD as this sends void * in the lparam. this 
gives a sip.voidptr, but again it is unusable because it is unsized. 
partial conversion to a python string shows that it does contain the 
expected value, though.

i realise all this stuff is indirectly implemented in the high-level 
api, but it would still be nice to have it working properly, if 
possible. i personally use the low-level api a lot for experimenting 
with things in python.

probably not ever going to be high on your todo list, but i just thought 
i'd ask :)


More information about the PyQt mailing list