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

Arno Rehn arno at arnorehn.de
Wed Apr 14 16:48:21 UTC 2010


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.

-- 
Arno Rehn
arno at arnorehn.de



More information about the Kde-bindings mailing list