[PyQt] Sip wrapping error

Sébastien Petitdemange sebastien.petitdemange at esrf.fr
Fri Feb 19 09:42:51 GMT 2010


Hi Phil,

We use the latest sip (4.10) to wrap your C++ library and I think I
found a bug in the wrapping code generated by sip.

Sip Code:

class HwSyncCtrlObj
{
%TypeHeaderCode
#include <HwSyncCtrlObj.h>
using namespace lima;
%End
public:
	struct ValidRangesType
	{
	  double min_exp_time;
	  double max_exp_time;
	  double min_lat_time;
	  double max_lat_time;
	  const char* __repr__();
%MethodCode
std::ostringstream str;
str << *sipCpp;
sipRes = str.str().c_str();
%End
	};

	virtual void getValidRanges(HwSyncCtrlObj::ValidRangesType& range
/Out/) = 0;
};

C++ Code result:

void sipVH_lima_8(sip_gilstate_t sipGILState,PyObject
*sipMethod,HwSyncCtrlObj::ValidRangesType& a0)
{
    PyObject *resObj = sipCallMethod(0,sipMethod,"");

    if (!resObj ||
sipParseResult(0,sipMethod,resObj,"D4",sipType_HwSyncCtrlObj_ValidRangesType,&a0)
< 0)
        PyErr_Print();

    Py_XDECREF(resObj);
    Py_DECREF(sipMethod);

    SIP_RELEASE_GIL(sipGILState)
}

We try to get the pointer of a0 instead of the reference!

Is it a bug or miss I something?

Thanks in advance,

SEB
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sebastien_petitdemange.vcf
Type: text/x-vcard
Size: 210 bytes
Desc: not available
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100219/8965e029/attachment.vcf>


More information about the PyQt mailing list