| | |
| | | { |
| | | if(m_curItem==nullptr)return; |
| | | qDebug()<<"添加公司信息,在节点:"<<m_curItem->text(0); |
| | | on_pushButton_laodFile_clicked(); |
| | | } |
| | | |
| | | void ConverInfo2::deleteInfo() |
| | | { |
| | | if(m_curItem==nullptr)return; |
| | | qDebug()<<"删除公司信息,节点:"<<m_curItem->text(0); |
| | | auto resList = m_curItem->takeChildren(); |
| | | |
| | | qDebug()<<"删除数量:"<<resList.size(); |
| | | } |
| | | |
| | | void ConverInfo2::on_treeWidget_doubleClicked(const QModelIndex &index) |
| | |
| | | for(int k=0;k<ui->treeWidget->topLevelItemCount();++k){ |
| | | QTreeWidgetItem *tmp = ui->treeWidget->topLevelItem(k); |
| | | qDebug()<<k<<tmp->text(0)<<upName.toString(); |
| | | if(upName.toString()+"(汇总)" == tmp->text(0)){ |
| | | int pos = tmp->text(0).indexOf(upName.toString()+"(汇总)"); |
| | | if(upName.toString()+"(汇总)" == tmp->text(0) || pos != -1){ |
| | | top = tmp; |
| | | break; |
| | | } |
| | |
| | | if(top){ // 存在,则添加到孩子列表中 |
| | | QTreeWidgetItem *top1 = new QTreeWidgetItem(top); |
| | | top1->setText(0,name.toString()); |
| | | top->setText(0,upName.toString()+"(汇总)下级数:"+QString::number(top->childCount()-1)); |
| | | }else{ // 不存在,则新建一个列表 |
| | | QTreeWidgetItem *top1 = new QTreeWidgetItem(ui->treeWidget); |
| | | top1->setText(0,name.toString()+"(汇总)"); |
| | | QTreeWidgetItem *top2 = new QTreeWidgetItem(top1); |
| | | top2->setText(0,name.toString()+"(本级)"); |
| | | top1->setText(0,name.toString()+"(汇总)下级数:"+QString::number(top1->childCount()-1)); |
| | | } |
| | | } |
| | | |
| | |
| | | top1->setText(0,name.toString()+"(汇总)"); |
| | | QTreeWidgetItem *top2 = new QTreeWidgetItem(top1); |
| | | top2->setText(0,name.toString()+"(本级)"); |
| | | top1->setText(0,name.toString()+"(汇总)下级数:"+QString::number(top1->childCount()-1)); |
| | | } |
| | | |
| | | } |