标签:items string highlight div 名称 ring span item deb
1 TreeItem* TreeModel::GetItem(QStringList& list, TreeItem* parent ,int deep) 2 { 3 if( list.at(deep) == parent->data(0).toString()) 4 { 5 if( ++deep == list.count()) 6 return parent; 7 } 8 foreach(TreeItem* child,parent->childItems) 9 { 10 TreeItem* findItem = GetItem(list,child,deep); 11 if(findItem != nullptr) 12 return findItem; 13 } 14 return nullptr; 15 } 16 bool TreeModel::GetMapList(QStringList& list,QMap<QString,TreeItem *>& map) 17 { 18 foreach(QString path,list) 19 { 20 QStringList strlist = path.split(‘\\‘); 21 TreeItem * item = GetItem(strlist,rootItem); 22 if( item != nullptr) 23 { 24 map.insert(path,item); 25 qDebug()<<"find Item:"<<item->data(0) <<item->data(1); 26 } 27 } 28 return true; 29 }
标签:items string highlight div 名称 ring span item deb
原文地址:https://www.cnblogs.com/xuyouzhu/p/9559676.html