使用 QtRuby (通过qtbindings)我正在尝试将项目添加到QTreeWidget
. 它说它有一个insertTopLevelItems()
方法,但它没有响应它:
hier = $my.appHierarchy
hier.column_count = 2
hier.header_labels = ['element', 'kind']
p hier.class, hier.methods.grep(/insert/)
#=> Qt::TreeWidget
#=> ["insertAction", "insertActions", "insertTopLevelItem", "insertTopLevelItems"]
hier.insertTopLevelItems ['x','y']
#=> in `method_missing': undefined method `insertTopLevelItems' for #<Qt::TreeWidget:0x007fc6c9153528> (NoMethodError)
如何将项目添加到此小部件?
红宝石 2.0.0p353; Qt 4.8.6;OS X 10.9.5