phillip_Qt
11th November 2009, 12:35
Hi All
I'm writing an application where i'm using tree widget. if i click on the treewidget an input dialog is poping up and asking to enter a string. i need to update that string in treewidget. Below is my code. But its not updating in tree widget. Can ny body help me.
bool b;
QString name = QInputDialog::getText( this,
tr( "New name" ),
tr( "Please enter the name " ),
QLineEdit::Normal, tr( "New classroom" ), &b);
if(b && !name.isEmpty())
{
QStringList strlist;
strlist.push_back(classroom_name);
QTreeWidgetItem temptreelst(strlist);
m_name.append(&temptreelst); //QList<QTreeWidgetItem *> m_name is to colect the list of names and amember variable
ui->treeWidget->addTopLevelItem(&temptreelst);
ui->treeWidget->expandAll();
}
Thank u all.
I'm writing an application where i'm using tree widget. if i click on the treewidget an input dialog is poping up and asking to enter a string. i need to update that string in treewidget. Below is my code. But its not updating in tree widget. Can ny body help me.
bool b;
QString name = QInputDialog::getText( this,
tr( "New name" ),
tr( "Please enter the name " ),
QLineEdit::Normal, tr( "New classroom" ), &b);
if(b && !name.isEmpty())
{
QStringList strlist;
strlist.push_back(classroom_name);
QTreeWidgetItem temptreelst(strlist);
m_name.append(&temptreelst); //QList<QTreeWidgetItem *> m_name is to colect the list of names and amember variable
ui->treeWidget->addTopLevelItem(&temptreelst);
ui->treeWidget->expandAll();
}
Thank u all.