[Kde-bindings] QtRuby's is_a? / kind_of? behavior

airh2002 airh2002 at oak.dti.ne.jp
Sun Aug 9 11:40:33 UTC 2009


QtRuby's is_a? / kind_of? behavior doesn't correspond with QtRuby's
inheritance.

I attach test ruby script "test_fot_inheritance.rb" to confirm results
of Qt::Base.ancestors, instance_of?, and kind_of? methods.

In this script, cases of normal Ruby object behave as expected,
but cases of QtRuby object(Qt::Label) don't.
Qt::Base.ancestors and instance_of? are behaving correctly,
but kind_of? is not because of Qt::Base class don't override is_a? or
kind_of?

So I add is_a? / kind_of? method definition on Qt::Base class in qtruby4.rb.
I also attach its diff file "qtruby4_rb.diff".

----------------
Youhei Kondou
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: qtruby4_rb.diff
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20090809/3996e69f/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test_fot_inheritance.rb
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20090809/3996e69f/attachment-0001.ksh>


More information about the Kde-bindings mailing list