PDA

View Full Version : QIODEvice



mickey
5th July 2006, 17:19
hi, i'm trying to use qiodevice to do this....


QFile f(file);
bool b = f.open(IO_ReadOnly);
bool read_result = Read(f);



bool Read(QIODevice& io) {
QDomDocument doc;
QString s = doc.toString(); // this cause runtime error
// cout << " s " << s << endl;
if ( !doc.setContent( &io ) ) return false; //here program exit

Why this fragment has that behavoiur? (which cause) thanks

mickey
5th July 2006, 19:29
hi, I try to open other xml file and I haven't that problem; I change this code and I see a console error; I don't understand why my file get that error....maybe bacause I put some
indent... like xstrm << "here there are some spaces </PLAIN>\n"; ??


if ( !doc.setContent( &io, &error ) ) {
cout << "err " << error << endl;
err unexpected character

mickey
5th July 2006, 20:00
ok my file wasn't xml standard