[PyKDE] sip wrapping QCanvasItem's rtti()

Anthony Heading aheading at jpmorgan.com
Wed Jan 15 00:14:01 GMT 2003


On Tue, Jan 14, 2003 at 04:45:57PM -0600, Frederick Polgardy Jr wrote:
> On Tuesday 14 January 2003 04:41 pm, Anthony Heading wrote:
> > 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();
> 
> No it doesn't.  That's the whole point of a virtual function call.  rtti() 
> is invoked on the actual object, it's not determined by the ptr class.
> 

Yes....

Let me restate, I was being sloppy by including the cast at all.

Rather than:
		res = sipCpp -> QCanvasItem::rtti();

should we not have:

		res = sipCpp -> rtti();


The current form is forcibly selecting the base class implementation
of the function.

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