Hi everyone!
I keep trying to implement some piece of code to write in a xml file some tags.
I see this video tutorial:
https://www.youtube.com/watch?v=NXGE5XUrRSI
I'll show you below
#include <QtXml>
int main(int argc, char *argv[])
{
Q_UNUSED(argc);
Q_UNUSED(argv);
// Write XML
// Make the root element
// Add it to the document
document.appendChild(root);
// Write to file
QFile file("C:/XML_OUT/gbxml.xml");
{
qDebug() << "Failed to open file for writting";
return -1;
}
else
{
// stream << document.toString();
file.close();
qDebug() << "Finished";
}
return a.exec();
}
#include <QtXml>
int main(int argc, char *argv[])
{
Q_UNUSED(argc);
Q_UNUSED(argv);
// Write XML
QDomComment document;
// Make the root element
QDomElement root = document.createElement("Campus");
// Add it to the document
document.appendChild(root);
// Write to file
QFile file("C:/XML_OUT/gbxml.xml");
if(!file.open(QIODevice::WriteOnly | QIODevice::Text ))
{
qDebug() << "Failed to open file for writting";
return -1;
}
else
{
QTextStream stream(&file);
// stream << document.toString();
file.close();
qDebug() << "Finished";
}
return a.exec();
}
To copy to clipboard, switch view to plain text mode
error: C2039: 'createElement': no es un miembro de 'QDomComment'
error: C2039: 'toString': no es un miembro de 'QDomComment'
Bookmarks