标签:new tin got lse ast str == empty pop
1 void TreeModel::settingsUpdate(const QStringList &lines){ 2 QList<TreeItem*> parents; 3 TreeItem* it1,* item1 = new TreeItem(rootItem->itemData); 4 TreeItem* it2,* item2 = rootItem; 5 QList<int> indexs; 6 int i1 =0 ,i2 = 0; 7 setupModelData(lines,item1); 8 _repeat: 9 for(; i1 < item1->childCount() ; ++i1) 10 for(; i2 < item2->childCount() ; ++i2) 11 { 12 it1 = item1->child(i1); 13 it2 = item2->child(i2); 14 if( it1->data(0).toString() == it2->data(0).toString() ) 15 { 16 if(it1->childCount() == 0 ) 17 { 18 QModelIndex index = createIndex(it2->childNumber(), 2, it2); 19 if (it2->setData(index.column(), it1->data(2))) 20 emit dataChanged(index, index); 21 settingItem.enqueue(it2); 22 ++i2; 23 break; 24 } 25 else if(it2->childCount() > 0) 26 { 27 parents << item1 << item2; 28 indexs << i1 + 1 << i2 + 1; 29 item1 = it1; 30 item2 = it2; 31 i1 = 0 ; 32 i2 = 0 ; 33 goto _repeat; 34 } 35 } 36 } 37 if(!parents.isEmpty()) 38 { 39 item2 = parents.last(); 40 parents.pop_back(); 41 item1 = parents.last(); 42 parents.pop_back(); 43 44 i2 = indexs.last(); 45 indexs.pop_back(); 46 i1 = indexs.last(); 47 indexs.pop_back(); 48 goto _repeat; 49 } 50 delete item1; 51 optMode = OptWrite; 52 }
标签:new tin got lse ast str == empty pop
原文地址:https://www.cnblogs.com/xuyouzhu/p/9559696.html