[Qt-interest] subitems for QTableWidget

Alessandro Portale alessandro.portale at trolltech.com
Thu Jun 11 11:30:58 CEST 2009


Dear Sujan,

here is my final attempt to help You. Apparently, You want a tree structure, and You want columns. Good news is that it is possible.

a) You _need_ to use QTreeWidget
b) Use QTreeWidgetItem->addChild() to create hierarchical subitems.
c) In order to have multiple columns per item, call QTreeWidget::setColumnCount()
d) Set the columns data either with the QTreeWidgetItem constructor that takes a QStringList or via QTreeWidgetItem::setData(column, role, data)

Sujan Dasmahapatra wrote:
> I have a QTableWidget with only one column.I am suing it basically as 
> part  tree.But now I want to add some subitems under each part.Can  u 
> plss tell me how would I go about it.



More information about the Qt-interest-old mailing list