[PyQt] How to use sipAPIDef::api_get_pyobject and sipQtAPI::qt_connect

Jack Cosgrove jackcosgrove at gmail.com
Sat Nov 26 16:37:12 GMT 2011


Hi,

I'm trying to connect a C++ signal to a Python slot. What is the best
way to do this?

My current approach is to use sipQtAPI::qt_connect, and to do this I
need to apparently convert the C++ object to a PyObject using SIP. I do
that using sipAPIDef::api_get_pyobject. However whenever I call this
method using the appropriate sipType I get a segmentation fault.

I have included a small qmake project that replicates this behavior.
Could someone look it over and offer advice on what I am doing wrong?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PythonInteropDemo.tar.gz
Type: application/x-compressed-tar
Size: 15974 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20111126/4db10069/attachment-0001.bin>


More information about the PyQt mailing list