[Kde-bindings] korundum4 bug: Qt::ListView should have a method setModel

Robert Riemann robert.riemann at physik.hu-berlin.de
Wed Apr 14 18:42:55 UTC 2010


Am Mittwoch, 14. April 2010 18:48:21 schrieb Arno Rehn:
> On Tuesday 13 April 2010 21:33:11 Robert Riemann wrote:
> > Hi all,
> > 
> > I think I found another bug related to QListView. There should be a
> > method called setModel, but I get this in my app:
> > 
> > main.rb:230:in `method_missing': undefined method `setModel' for
> > #<Qt::ListView:0x00000001a1ca18> (NoMethodError)
> > 
> > QListView inherits from QAbstractItemView which defines the missing
> > method.
> 
> Could you please post your code? The following works ok for me:
> 
> $ irb -rQt
> irb(main):001:0> Qt::Application.new ARGV
> => #<Qt::Application:0x00000002a329d0 objectName="irb">
> irb(main):002:0> view = Qt::ListView.new
> => #<Qt::ListView:0x00000002a1a710 objectName="", x=0, y=0, width=640,
> height=480>
> irb(main):003:0> model = Qt::DirModel.new
> => #<Qt::DirModel:0x00000002a03e20 objectName="">
> irb(main):004:0> view.setModel model
> => nil
> 
> Maybe there's an argument mismatch, in which case no matching C++ method is
> found and a NoMethodError is then thrown.

Ok. I found the bug.  I defined the Qt::AbstractListModel::data(...) and at 
the same time a attr_accessor for @data. That might have caused the problem.

Thanks anyway,
Robert



More information about the Kde-bindings mailing list