接着这个问题,想判断重新命的名字和当前已存在的子节点没有重名。应该怎么做?
我的代码如下:
for(int i=0;i<root->childCount();i++)
{ while(1)
{
if(currentItem->text(0)==(root->child(i))->text(0))
{
QMessageBox::information(this, tr("提示"),tr("该容器名已经存在,请重新命名!"));
this->editItem(currentItem, 0);
}
else return;
}但是没效果,怎么办?