Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void parseMacros(QDomNode docElem)
- {
- qDebug() << "Hello" << endl;
- if(docElem.isNull())
- return;
- QDomElement e = n.toElement();
- qDebug() << e.tagName() << endl;
- if(e.tagName() == "name")
- {
- qDebug() << "name : " << e.text() << endl;
- }
- if(e.tagName() == "type")
- {
- qDebug() << "type : " << e.text() << endl;
- //parse(docElem.firstChild());
- }
- //parse(n.nextSibling());
- }
- QMap<QString, Macros> *MacrosDataController::load()
- {
- QMap<QString, Macros> *loadedMacroses = new QMap<QString, Macros>;
- QDomDocument doc("mydocument");
- QFile file("db.xml");
- file.open(QIODevice::ReadOnly);
- doc.setContent(&file);
- file.close();
- QDomElement docElem = doc.documentElement();
- QDomNode n = docElem.firstChild();
- while(!n.isNull()) {
- //QDomElement e = n.toElement(); // try to convert the node to an element.
- //if(!e.isNull()) {
- // qDebug() << qPrintable(e.tagName()) << " " << qPrintable(e.text()) << endl; // the node really is an element.
- //}
- parseMacros(n.firstChild());
- n = n.nextSibling();
- }
- exit(0);
- return loadedMacroses;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement