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
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