[Qt-interest] subitems for QTableWidget

Sujan Dasmahapatra sdh at lmglasfiber.com
Thu Jun 11 12:45:43 CEST 2009


Thakns to Allesandro also.

Kind Regards,
Sujan Dasmahapatra

-----Original Message-----
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Alessandro
Portale
Sent: Thursday, June 11, 2009 3:01 PM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] subitems for QTableWidget

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.
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list