
Originally Posted by
mickey
yes it was the error; but if I use .read() my app doesn't respond....
I coded this also:
f.open(IO_ReadOnly | IO_WriteOnly);
QDomElement tag1
= doc.
createElement ("PLAIN");
// SEE THIS!!!! QString plainText
= xstrm.
readLine();
// or .read() QDomText t1
= doc.
createTextNode(plainText
);
//QDomText t1 = doc.createTextNode("hello"); //with this ok
tag1.appendChild(t1);
QFile f(file);
f.open(IO_ReadOnly | IO_WriteOnly);
QTextStream xstrm(&f);
QDomElement tag1 = doc.createElement ("PLAIN"); // SEE THIS!!!!
Class.Write(QTextStream(&f));
QString plainText = xstrm.readLine(); // or .read()
QDomText t1 = doc.createTextNode(plainText);
//QDomText t1 = doc.createTextNode("hello"); //with this ok
tag1.appendChild(t1);
To copy to clipboard, switch view to plain text mode
xstrm << "hello\n";
}
void Class::Write(QTextStream &xstrm) {
xstrm << "hello\n";
}
To copy to clipboard, switch view to plain text mode
after this in my file I found:
hello
a line of ascii code
hello
a line of ascii code
To copy to clipboard, switch view to plain text mode
like above I'm trying to create a file; in that I like put "hello" with class.XML (this work); then I like put the contentent of file (in this case "hello") inside two tag <Plain> </plain>;
that doesn't work (but it works using
QDomText t1
= doc.
createTextNode("hello");
QDomText t1 = doc.createTextNode("hello");
To copy to clipboard, switch view to plain text mode
other thing: using f.open(IO_ReadOnly | IO_WriteOnly); when I save file the text is append at the end...why? with only IO_WriteOnly the file is destroyed everytime (I want this)...thanks
then I need put the
QDomText t1
= doc.
createTextNode(..............
);
QDomElement tag1 = doc.createElement ("PLAIN");
Class.Write(QTextStream(&f));
QDomText t1 = doc.createTextNode(..............);
To copy to clipboard, switch view to plain text mode
content of strm between tag PLAIN. How this?
Bookmarks