[Kde-perl] Overloading of Qt::ToolTip::maybeTip doesn't work

Richard Dale Richard_Dale at tipitina.demon.co.uk
Sat Oct 30 11:40:57 CEST 2004


On Saturday 30 October 2004 10:30, Ole Christensen wrote:
> Richard,
>
> I have investigated the thing a little bit more. The problem was that I
> used the latest CVS export. mapObject actually isn't called in this
> version any more. Tracking down the CVS logs I found that Germain Garand
> has removed two calls to mapObject in Qt.pm version 1.86. The log holds
> "don't map objects twice". Maybe one deletion happened unintentionally.
> I have no idea.
>
> http://cvs.sourceforge.net/viewcvs.py/perlqt/PerlQt-3/PerlQt/Qt.pm?r1=1.85&
>r2=1.86
That looks like a fix for a problem with Qt::Application.

> Your patch applied to 3.008 seems to work fine for me. Thanks a lot. An
> appropriate fix should also go into CVS if there is no serious drawback.
Good - I was about to get round to trying out your example. But I don't have 
PerlQt CVS access, so Germain will have to do that. 

There could be a problem if Qt::ToolTip instances don't get removed from the 
'mapObject' table. Normally the virtual destructor is subclassed, and there 
is a callback from there to remove the instance from the table - it gets done 
as soon as the C++ instance is deleted. 

As QToolTip doesn't have a virtual destructory, that can't be done. But there 
is code in PerlQt to remove it from the table on garbage collection though, 
and that should be sufficient.

> Even if Qt-4 is scheduled to have a virtual destructor for QToolTip,
> which should solve the problem anyway as far as I have understood.
I don't know why C++ allows you to declare non-virtual destructors anyway - it 
just seems to be a way of introducing obscure bugs/memory leaks.

-- Richard


More information about the Kde-perl mailing list