yes it was the error; but if I use .read() my app doesn't respond....
I coded this also:
Qt Code:
  1. QFile f(file);
  2. f.open(IO_ReadOnly | IO_WriteOnly);
  3. QTextStream xstrm(&f);
  4. Class.Write(QTextStream(&f));
  5. QString plainText = xstrm.readLine(); // or .read()
  6. QDomText t1 = doc.createTextNode(plainText);
  7. //QDomText t1 = doc.createTextNode("hello"); //with this ok
  8. tag1.appendChild(t1);
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. void Class::Write(QTextStream &xstrm) {
  2. xstrm << "hello\n";
  3. }
To copy to clipboard, switch view to plain text mode 
after this in my file I found:
Qt Code:
  1. hello
  2. a line of ascii code
To copy to clipboard, switch view to plain text mode 
why? "hello" is right...with "QDomText t1 = doc.createTextNode(plainText)" I'm trying to insert again "hello" in the file.....thanks