Hi guys,
lḿ writing few rows of code to edit XML like this:
Qt Code:
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <data>
  3. <fam_number>123</fam_number>
  4. </data>
To copy to clipboard, switch view to plain text mode 
So i google it, then l tought that, this should write xml (loaded by qresource):
Qt Code:
  1. QDomElement xmlroot= doc.createElement ("data");
  2. doc.appendChild (xmlroot);
  3. QStandardItem *root = model->item (0,0);
  4. QStandardItem *fam = root->child (0,0); // Here Segmantation FAULT
  5. fam->setText (family_number);
  6.  
  7. QFile file(":/data.xml");
  8. if(!file.open (QIODevice::WriteOnly | QIODevice::Text)) // Here FAILED to open
  9. qDebug () << "Fail";
  10. QTextStream stream(&file);
  11. stream << doc.toString ();
  12. file.close ();
To copy to clipboard, switch view to plain text mode 
But l get SEG FAILED and FAILED to open.
Can you please help me ? Thanks