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

Qt Code:
  1. #include <QtXml>
  2.  
  3. int main(int argc, char *argv[])
  4. {
  5. Q_UNUSED(argc);
  6. Q_UNUSED(argv);
  7.  
  8. // Write XML
  9. QDomComment document;
  10.  
  11. // Make the root element
  12. QDomElement root = document.createElement("Campus");
  13.  
  14. // Add it to the document
  15. document.appendChild(root);
  16.  
  17. // Write to file
  18. QFile file("C:/XML_OUT/gbxml.xml");
  19. if(!file.open(QIODevice::WriteOnly | QIODevice::Text ))
  20. {
  21. qDebug() << "Failed to open file for writting";
  22. return -1;
  23. }
  24. else
  25. {
  26. QTextStream stream(&file);
  27. // stream << document.toString();
  28. file.close();
  29. qDebug() << "Finished";
  30. }
  31.  
  32. return a.exec();
  33. }
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'