[PyQt] sip_api_convert_to_void_ptr returns NULL

Tom Brown nextstate at gmail.com
Sun Feb 7 01:06:04 GMT 2016


I have created a PyQt4 application on Windows 10 using Visual Studio 2015.

In short, I have compiled SIP 4.17 into a static library so that I can use
the api "sip_api_convert_to_void_ptr()". This api returns NULL when passed
a PyObject * containing a QRect.

Although, I am using PyQt4 binaries from Anaconda2-2.4.1.

I have created a Python extension module built with VS 2015. I am passing a
QRect to a function in the extension.

In the function, I am trying to do this:

PyObject *rect;

/* call python api to convert args to rect */

void *ptr = sip_api_convert_to_void_ptr( rect );

rect = (QRect *)ptr;

The debugger always shows that ptr is NULL. Even though rect is a valid
QRect wrapped by PyQt.

Any ideas on where I am going wrong here?

Thank you!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20160206/972e8b72/attachment.html>

More information about the PyQt mailing list