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

Alexander Kellett lypanov at
Mon Jan 12 13:12:45 UTC 2004

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 '"' + + '"'
>          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() << "\"";

so, i think its possible that i'm just misusing this entirely :)
i.e, maybe the ruby should be
or, as many other use cases suggest node.nodeValue().string().
Germain: maybe your khtml knowledge can enlighten me here? ;-)

that would explain why the cast was failing in any case :)

On Mon, Jan 12, 2004 at 11:52:55AM +0000, Richard Dale wrote:
> On Monday 12 January 2004 11:34, Richard Dale wrote:
> > Well, it looks to be a problem with cast_object_to() not working I would
> > have thought. Either check in the code for the method or post in on
> > kdebindings, but I think the best solution is to avoid needing it.
> Sorry, silly me found it now in Qt.cpp.

can you see any obvious problems with it other than the fact
that my actual test case may have been completely broken?
i'll try and make another testcase later on tonight when
i return home and i'lll also try the above two TEXT_NODE
use case fixes.

hopefully its just a mistake on my part :)
if so, i'll note down the BUG's, and warn against cast usage :)
it would be nice do start adding rdoc information to qtruby.rb
also i'd like to start doing so over the coming weekend and
then get some docs online.

do we have 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 


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...

More information about the Kde-bindings mailing list