[Kde-bindings] TreeWidgetItem problems
Miquel
ktalanet at yahoo.es
Thu May 17 09:49:26 UTC 2007
Hi there
I'm trying to code a Tree using ruby qt bindings (Qt v4.2.0 using
aboutQt() info).
This is my code.
@tree = Qt::TreeWidget.new(self)
self.setCentralWidget(@tree)
@rootItem = Qt::TreeWidgetItem.new(@tree)
@rootItem.setText(0, "Root")
0.upto(10) do |index|
item = Qt::TreeWidgetItem.new(@rootItem)
item.setText(0, "Node#{index}")
end
The problem is in 'item = Qt::TreeWidgetItem.new(@rootItem)', system
tells me:
unresolved constructor call Qt::TreeWidgetItem (ArgumentError)
and reading Qt documentation there are two constructors allowed:
QTreeWidgetItem ( QTreeWidget * parent, int type = Type )
QTreeWidgetItem ( QTreeWidgetItem * parent, int type = Type )
The first one is used in the @rootNode object creation and the second
one is the one which produces this message.
Can anybody help me?
Thanks in advance
Best regards
Miquel
More information about the Kde-bindings
mailing list