1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
QDomDocument doc;
QFile file("historique.xml");
file.open(QIODevice::ReadOnly);
doc.setContent(&file);
file.close();
QDomElement root = doc.documentElement();
QDomElement child = root.firstChild().toElement();
while(!child.isNull())
{
if (child.tagName() == "jour")
{
QDomElement grandChild = child.firstChild().toElement();
while(!grandChild.isNull())
{
if (grandChild.tagName() == "date")
{
QDomElement grandGrandChild = grandChild.firstChild().toElement();
while(!grandGrandChild.isNull())
{
if (grandGrandChild.tagName() == "unHisto")
{
QDomElement grandGrandGrandChild = grandGrandChild.firstChild().toElement();
while(!grandGrandGrandChild.isNull())
{
if (grandGrandGrandChild.tagName() == "url")
{
listeUrl << grandGrandGrandChild.text();
splitUrl(grandGrandGrandChild.text());
}
grandGrandGrandChild = grandGrandGrandChild.nextSibling().toElement();
}
}
grandGrandChild = grandGrandChild.nextSibling().toElement();
}
}
grandChild = grandChild.nextSibling().toElement();
}
}
} |
Partager