logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

Re: Overloading of Qt::ToolTip::maybeTip doesn't work: msg#00015

kde.devel.perl

Subject: Re: Overloading of Qt::ToolTip::maybeTip doesn't work

Richard,

unfortunately the patch you suggested does not fix the problem. Everything unchanged. Find the corresponding output below. Note the "-- Ole" ;-) So the right lib actually gets used. The mapObject function obviously does not get called at all in this context. I put an fprintf there which is not reached.

virtual 0x8746220->QToolTip::maybeTip() called
Cannot find object for virtual method -- Ole

I applied the patch on a fresh cvs export from sourceforge. Is there anything else I could do to track down the problem? Thanks in any case for your help.


Regards,

Ole.


Richard Dale wrote:
On Wednesday 27 October 2004 22:48, Ole Christensen wrote:

Hi,

I am trying to implement a dynamic tooltip. The problem is that
overloading Qt::ToolTip::maybeTip does not work for me. I already have
reimplemented virtual functions in perl, but for some reason it does not
work for maybeTip. QToolTip is not a subclass of QObject. Does that matter?

When I switch on debugging of virtual functions I get:

virtual 0x8772ea0->QToolTip::maybeTip() called
Cannot find object for virtual method

I am using
PerlQt 3.008
Qt 3.3.3
perl 5.8.2

I had the same problem as this with qtruby. Here is the entry from the qtruby ChangeLog:

* If a class doesn't have a virtual destructor, then no mapping was being
kept from the C++ instance to the corresponding ruby value. If the class
had virtual method callbacks, this meant that the ruby instance couldn't
be found, and the callback couldn't be made.

* Hence, the Qt::ToolTip callback in examples/qt-examples/tooltip didn't
work, as that class doesn't have a virtual destructor.

For PerlQt, you would need to remove this test from the mapObject() function in Qt.xs:

if(!c.hasVirtual() ) {
XSRETURN_EMPTY;
}

void
mapObject(obj)
SV *obj
CODE:
smokeperl_object *o = sv_obj_info(obj);
if(!o)
XSRETURN_EMPTY;
SmokeClass c( o->smoke, o->classId );
// if(!c.hasVirtual() ) {
// XSRETURN_EMPTY;
// }
mapPointer(obj, o, pointer_map, o->classId, 0);

So that a mapping of the pointer from a C++ instance to a perl instance is always kept.

-- Richard
_______________________________________________
Kde-perl mailing list
Kde-perl@xxxxxxx
https://mail.kde.org/mailman/listinfo/kde-perl





Only community members can participate in forum threads. You must Register or log in to contribute.

<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo