[PyKDE] sip wrapping QCanvasItem's rtti()
Anthony Heading
aheading at jpmorgan.com
Tue Jan 14 23:43:01 GMT 2003
Hi,
Having subclassed in C++ a Qt Canvas item, and overridden
its rtti() method, the Python rtti() function appears always
to return 0 regardless.
The generated C++ code (in sipqtcanvasQCanvasItem.cpp) has the following lines:
static PyObject *sipDo_QCanvasItem_rtti(PyObject *sipThisObj,PyObject *sipArgs)
{
int sipArgsParsed = 0;
{
QCanvasItem *sipCpp;
if (sipParseArgs(&sipArgsParsed,sipArgs,"m",sipThisObj,sipClass_QCanvasItem,&sipCpp))
{
int res;
Py_BEGIN_ALLOW_THREADS
res = sipCpp -> QCanvasItem::rtti();
Py_END_ALLOW_THREADS
return PyInt_FromLong((long)res);
}
}
// Report an error if the arguments couldn't be parsed.
sipNoMethod(sipArgsParsed,sipName_qtcanvas_QCanvasItem,sipName_qt_rtti);
return NULL;
}
So this appears to be forcing a call to the base class version of the
function, which seems rather inappropriate for an rtti() function...
Should this not read:
res = (QCanvasItem*)sipCpp -> rtti();
or something like that?
Regards
Anthony
This communication is for informational purposes only. It is not intended as
an offer or solicitation for the purchase or sale of any financial instrument
or as an official confirmation of any transaction. All market prices, data
and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of J.P. Morgan Chase & Co., its
subsidiaries and affiliates.
More information about the PyQt
mailing list