Qt学习4 删除xml某个标签下所有子标签
QDomElement flowChart = listFlowChart.at(0).toElement();
QDomNodeList listAllNodes = flowChart.childNodes();
while (listAllNodes.size() > 0)
{
flowChart.removeChild(listAllNodes.at(0));
}
注意:不能用for循环来移除标签。因为从listAllNode中每移除一个标签,listAllNode.size()都会减一

浙公网安备 33010602011771号