Why this crash ...?

is an other method to debug?


Qt Code:
  1. QString Gui_Tidy::Createtag(QString inputfile,QString set_lang)
  2. {
  3. QString inside="File not found!";
  4. qDebug() << "### open file " << inputfile;
  5. QFile file(inputfile);
  6. if (file.exists()) {
  7. qDebug() << "### file found ok " << inputfile;
  8. if (file.open(QFile::ReadOnly | QFile::Text)) {
  9. inside =file.readAll();
  10. file.close();
  11. }
  12. }
  13. QDomDocument doc("shghshsh");
  14. QDomElement root = doc.createElement("root");
  15. doc.createElementNS("http://www.pulitzer.ch/2005/shop/shema/1.0/","s");
  16. doc.createElementNS("http://www.pulitzer.ch/2005/PuliCMS/1.0","cms");
  17. doc.appendChild(root);
  18. QDomElement page = doc.createElementNS("http://www.pulitzer.ch/2005/PuliCMS/1.0","page");
  19. root.appendChild(page);
  20. QDomAttr language = e.attributeNode("la");
  21. language.setValue(set_lang);
  22. page.setAttributeNodeNS(language);
  23. QDomText t = doc.createTextNode(inside); /* filter self text? */
  24. page.appendChild(t);
  25. QString xml = doc.toString();
  26. qDebug() << "### xml result " << xml;
  27. return xml;
  28. }
To copy to clipboard, switch view to plain text mode