QDOMLite.h. Quick and Dirty Document Object Model. Fast and low-resource one-file XML.
in your .pro:
CONFIG += c++11
DEFINES += QT_USE_QSTRINGBUILDER
CONFIG += c++11
DEFINES += QT_USE_QSTRINGBUILDER
To copy to clipboard, switch view to plain text mode
Parse:
ui->treeWidget->addTopLevelItem(i);
QDomLiteDocument d(â€yourfile.xml");
parseElement(d.documentElement,i);
void parseElement(QDomLiteElement* e, QTreeWidgetItem* i)
{
for (QDomLiteElement* c : e->childElements) parseElement(c,new QTreeWidgetItem(i,{c->tag}));
}
QTreeWidgetItem* i = new QTreeWidgetItem({"Document"});
ui->treeWidget->addTopLevelItem(i);
QDomLiteDocument d(â€yourfile.xml");
parseElement(d.documentElement,i);
void parseElement(QDomLiteElement* e, QTreeWidgetItem* i)
{
for (QDomLiteElement* c : e->childElements) parseElement(c,new QTreeWidgetItem(i,{c->tag}));
}
To copy to clipboard, switch view to plain text mode
File:
https://www.dropbox.com/s/7q39f1y31g...domlite.h?dl=0
Bookmarks