1 #include "datfileutil.h"
4 DatFileUtil::DatFileUtil(QWidget *parent) :
9 void DatFileUtil::open()
11 QString fileName = QFileDialog::getOpenFileName(this, tr("Open Dat File"),
12 QDir::currentPath(), tr("XML Dat Files (*.xml)"));
13 if (fileName.isEmpty()) return;
15 QDomDocument doc("datFile");
17 if (!file.open(QIODevice::ReadOnly))
19 if (!doc.setContent(&file)) {
25 QDomElement docElem = doc.documentElement();
26 QDomNode n = docElem.firstChild();
28 QDomElement e = n.toElement(); // try to convert the node to an element.
30 qDebug() << qPrintable(e.tagName()) << endl; // the node really is an element.