[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-bindings
Subject: [Kde-bindings] Qt::Object#find_children doesn't work correctly with
From: Stefano Crocco <stefano.crocco () alice ! it>
Date: 2010-02-03 12:33:56
Message-ID: 201002031333.56252.stefano.crocco () alice ! it
[Download RAW message or body]
In theory, Qt::Object#find_children should return all children of the given
class. However, if the class I pass as argument is defined in ruby, rather
than in C++, the method returns a list of all children of the object instead.
You can see this running the following code:
require 'Qt4'
class W < Qt::Widget
end
a = Qt::Application.new []
mw = Qt::MainWindow.new
w1 = W.new mw
w2 = Qt::PushButton.new mw
p mw.find_children(W)
p mw.find_children(Qt::PushButton)
mw.find_children(Qt::PushButton) correctly returns an array with a single
element, w2. mw.find_children(W), however, returns an array with three
elements: one of class Qt::RubberBand, one of class W and one of class
Qt::PushButton. The expected behaviour, instead, is to return an array with a
single element of class W.
By the way, I just noticed that qtruby givens a huge number of warnings when
running under ruby 1.9 (actually, there are only two warnings but they're
repeated a large number of times). The simple code
require 'Qt4'
if ruby is run with the -w switch produces a list of this two warnings:
/usr/lib/ruby19/site_ruby/1.9.1/Qt/qtruby4.rb:2498: warning: method redefined;
discarding old const_missing
/usr/lib/ruby19/site_ruby/1.9.1/Qt/qtruby4.rb:2498: warning: method redefined;
discarding old method_missing
I tried to find out the cause, but I don't know enough of qtruby internals to
find out what's wrong.
Also ruby 1.9 complains about a wrong indentation in line 1381 of qtruby4.rb.
Looking at that line, it's clear that the indentation is indeed wrong.
Thanks for the attention
Stefano
_______________________________________________
Kde-bindings mailing list
Kde-bindings@kde.org
https://mail.kde.org/mailman/listinfo/kde-bindings
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic