[PyQt] Error when converting QVariant back to Python object
Phil Thompson
phil at riverbankcomputing.com
Sat May 29 10:00:07 BST 2010
On Thu, 27 May 2010 19:36:20 +0100, Baz Walter <bazwal at ftml.net> wrote:
> On 27/05/10 18:44, Baz Walter wrote:
>> when i connect a handler to the SCN_MODIFIED signal in QScintilla-2.4.3
>> i see the following error:
>>
>> TypeError: unable to convert a QVariant back to a Python object
>>
>> i've tried setting sip.setapi('QVariant', 2), but to no avail.
>>
>> this is using: gcc 4.4.1, python 2.6.4, qt 4.6.2, sip 4.10, pyqt 4.7,
>> qsci 2.4.3
>>
>> i don't see the error when using: gcc 4.4.1, python 2.6.4, qt 4.5.3, sip
>> 4.9.1, pyqt 4.6.1, qsci 2.4
>
> i also tried with gcc 4.4.1, python 2.6.5, qt 4.6.2, sip 4.10.2, pyqt
> 4.7.3, qsci 2.4.3, but got the same error.
>
> after experimenting with the pyqt 4.6.1 build, i got a segfault when
> trying to type in the qscintilla editor. so it looks like the
> SCN_MODIFIED signal just doesn't work at all in python at the moment :(
>
> any chance this could be fixed, please?
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.
Phil
More information about the PyQt
mailing list