PDA

View Full Version : How to write TreewidgetItem validations



mkkguru
1st February 2010, 11:19
hi,
I want to keep below QTreewidgetItem as top position and only one for Treewidget and should have subitems as shown in figure,

//this item should be at top position (1st treewidgetitem )



QTreeWidgetItem *lnx = new QTreeWidgetItem(ui->treeWidget);
lnx->setData(0, Qt::UserRole, "ECLOGIC-LNX");
lnx->setText(0,tr("ECLOGIC-LNX"));
......................
//remaining part


validations:
When ever i want to have another ECLogic-lnx(2nd treewidgetitem) ,the above 1st treewidgetitem has to close automatically and save,and then 2nd treewidgetitem and its subclasses has to shown in the treewidget.
can you plz tell me how to write the code ?