hi, i'm trying to use qiodevice to do this....
bool b = f.open(IO_ReadOnly);
bool read_result = Read(f);
QFile f(file);
bool b = f.open(IO_ReadOnly);
bool read_result = Read(f);
To copy to clipboard, switch view to plain text mode
bool Read(QIODevice& io) {
QString s
= doc.
toString();
// this cause runtime error // cout << " s " << s << endl;
if ( !doc.setContent( &io ) ) return false; //here program exit
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
To copy to clipboard, switch view to plain text mode
Why this fragment has that behavoiur? (which cause) thanks
Bookmarks