[PyKDE] PyQt C API
jbublitz at nwinternet.com
Tue Oct 18 17:39:37 BST 2005
On Tuesday 18 October 2005 00:44, Toby Dickenson wrote:
> I am considering translating a few functions of our large PyQt application
> to C (or, probably, pyrex) as a performance optimisation, but I have
> stumbled at the first hurdle. How do you convert a PyObject pointer to a
> PyQt object into a pointer to the Qt C++ object?
> Thanks in advance,
Is this what you mean?
PyObject *elem; // Points to QRect object type
int iserr = 0;
cpp = (QRect *)sipForceConvertTo_QRect (elem, &iserr);
*sipIsErr = 1;
The only thing that would change in most cases is substituting the particular
Qt object type of interest for QRect everywhere. The "sipIsErr" is part of
%MappedTypeCode - probably won't apply most places.
More information about the PyQt