cast_object_to bug / PerlQt cvs compilation (Was Re: [Kde-bindings] [Bug 71316] QtRuby : Segmentation fault when loading Qt)

Richard Dale Richard_Dale at
Tue Jan 13 09:28:16 UTC 2004

On Monday 12 January 2004 21:41, Alexander Kellett wrote:
> On Monday 12 January 2004 22:08, Richard Dale wrote:
> > I updated the current kalyptus and smoke/kde with kdelibs, and it all
> > built fine for me. BTW Alex for nitive spookers the wood is 'weird'.. :)
> it worked even on pressing the debug button?
> if so, thats just plain wierd as your platform
> ain't crashing with blatently wrong code :)
> but then it just looks stupidly wierd :)
> thats me most commonly mispelt word
> and so 'as it always been, since the
> days when i was but a wee ickle boy,
> and hopefully till the day comes that
> i turn all grown up and stuff :)
Just remember the rule 'I before E except after C', then remember it's wrong, 
I suppose that's what I do. Sorry about this, spelling corrections should be 
OT on this list.

I thought it wouldn't start with a URL in BASEDOCURL for you, but it did for 
me. But, it did crash when I pressed the debug button - or at least exited.

> > Alex's example all seemed to work as expected when I tried it. I think
> > the cast_to_object() is correct, even though the malloc'ing might need to
> > be tidied up. And perhaps the method rename dynamic_cast(), and passed a
> > Class as arg, rather than the classname as a String.
> the cast_to_object is pretty much certain correct
> it just turned out that the lack of ability to lookup
> constants really is a major problem as i managed
> to copy the wrong value for TEXT_NODE :)
> so, the fault was in the usage case. please see my
> cc:'ed commit log from a few hours back :)
> (well, unless you already have and i just haven't
> got to the email in my inbox yet ... :))
This works fine for me:

         puts "NODE NAME :: #{node.inspect}"
         if node.nodeType == DOM::Node::TEXT_NODE
            blah = Qt::Internal::cast_object_to(node, "DOM::Text")
            str = puts '"' + + '"'

It's just that the classname string was wrong (no KDE:: needed), which I think 
is a good argument for passing a Class instead.

-- Richard

More information about the Kde-bindings mailing list