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

Germain Garand germain at ebooksfrance.org
Tue Jan 13 10:46:27 UTC 2004


Le Lundi 12 Janvier 2004 13:12, Alexander Kellett a écrit :
> On Mon, Jan 12, 2004 at 11:34:28AM +0000, Richard Dale wrote:
> > I can't find that method in
> > kdebindings/qtruby/rubylib/qtruby/lib/Qt/qtruby.rb - is that where I
> > should be looking? I think we need to fix the runtime to know about rtti
> > that it can get from node.nodeType, and instanciate an instance of the
> > correct  DOM:: class.
>
> On Mon, Jan 12, 2004 at 11:34:28AM +0000, Richard Dale wrote:
> >      until node.isNull
> >          puts "NODE NAME :: #{node.inspect}"
> >          if node.nodeType == 9 # DOM::Node::TEXT_NODE
> >             blah = Qt::Internal::cast_object_to(node, "KDE::DOM::Text")
> >             str = puts '"' + blah.data.string + '"'
> >          end
> >          if not node.firstChild.isNull
>
> how exactly would it be able to instanciate the correct dom class?
> the code in c++ looks like:
>
>    case Node::TEXT_NODE:
>       outputStream << " \"" << Text(node).data().string() << "\"";
>       break;
>
> so, i think its possible that i'm just misusing this entirely :)
> i.e, maybe the ruby should be Text.new(node).data().string()
> or, as many other use cases suggest node.nodeValue().string().
> Germain: maybe your khtml knowledge can enlighten me here? ;-)
>

Hi Alex, at the moment I'm trying to get my internal temp under 39.5 so my 
brain is mostly out of order... all what you write is appearing as funny 
dancing bears with tutus to me :-)

However what I see from the above is you are using an hard coded numeric value 
instead of the enum call? 
And from current cvsapi, TEXT_NODE is 3, not 9, so I'm not impressed if it is 
not happy with the cast :-)

> do we have bindings.kde.org or so?
> maybe for 3.2.1 it would be nice to have some "press releases" for kde
> bindings as well as links to working PerlKDE bindings, it really is a shame
> that we couldn't get that into

yes a better bindings page would be great... it has really become a big 
strength of KDE lately... java, objc, c#, perl, ruby, python...
what a list!

As for PerlKDE, I don't really regret that it's not in CVS at this point, it's 
just not complete enough. I expect it to be dead ready by mid february, not 
before.

>
> cheers,
> Alex
>
> p.s: Germain: the kludgeror test case is awesome - the xmlgui part is
> now working for the ruby port here, as is the argument parsing tests,
> just a few signals are still broken unfortunately...

thanks :-) it was very handy for my khtml work, but we can do much much more 
fancy stuff :-)
It's so easy to manipulate those document trees when compared to C++ and the 
hellish recompilations it requires.





More information about the Kde-bindings mailing list