[Qt-interest] I want to have a subitem of QTableWidgetItem

David Ching dc at remove-this.dcsoft.com
Thu Jun 11 17:23:46 CEST 2009


> "Sujan Dasmahapatra" <sujan.dasmahapatra at gmail.com> wrote in message 
> news:b3126990906101325n1667ad5dr48d95c4c275ce5d1 at mail.gmail.com...
> Yess Mr Alessandro
> I am now using QTreeWidget.I am facing problem in that,the items are not 
> being aligned at the same row.I am setting different columns but they're > 
> coming with different row also.How can I set them to be shown at the same 
> row. ??? pls tell me someone


There is one QTreeWidgetItem per row.  Change the text in each column 
something like:

  QTreeWidgetItem *pItem = new 
QTreeWidgetItem(ui.accountTree->invisibleRootItem());
  pItem->setText( 0, "column 1" );
  pItem->setText( 1, "column 2" );
  pItem->setText( 2, "column 3" );


This makes one row with 3 columns having text of "column 1", "column 2", 
"column 3", respectively.

-- David




More information about the Qt-interest-old mailing list