Results 1 to 3 of 3

Thread: QIODEvice

  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default QIODEvice

    hi, i'm trying to use qiodevice to do this....
    Qt Code:
    1. QFile f(file);
    2. bool b = f.open(IO_ReadOnly);
    3. bool read_result = Read(f);
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. bool Read(QIODevice& io) {
    2. QString s = doc.toString(); // this cause runtime error
    3. // cout << " s " << s << endl;
    4. 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
    Last edited by mickey; 5th July 2006 at 17:54.
    Regards

  2. #2
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: QIODEvice

    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"; ??
    Qt Code:
    1. if ( !doc.setContent( &io, &error ) ) {
    2. cout << "err " << error << endl;
    3. err unexpected character
    To copy to clipboard, switch view to plain text mode 
    Regards

  3. #3
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: QIODEvice

    ok my file wasn't xml standard
    Regards

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.