Results 1 to 10 of 10

Thread: Bug in Qt4.3.3 QXmlSimpleReader::reset() ?

  1. #1
    Join Date
    May 2007
    Posts
    91
    Thanks
    60
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy Bug in Qt4.3.3 QXmlSimpleReader::reset() ?

    I first post a thread here: http://www.qtcentre.org/forum/f-qt-p...sax2-7517.html

    I just compiled Qt 4.3.3 open source edition with Visual C++ 2005 Express. I tried a small "hello world" example and it works fine.

    But when I tried to compile my previous project using qt4.2.2 commercial with MSVS2005, I run into a problem exactly in the above thread.
    [HTML]Parser error at line 1, column 1: unexpected end of file.[/HTML]

    I have used QXmlSimpleReader::reset() before the second parsing, seems it doesn't work.
    Then I tried QFile::seek(0), it turns out fine.

    pretty strange, it is a bug in qt4.3.3 ?
    Last edited by Shawn; 8th December 2007 at 13:54.

  2. #2
    Join Date
    May 2007
    Posts
    91
    Thanks
    60
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Bug in Qt4.3.3 QXmlSimpleReader::reset() ?

    Any body answer this question ?

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Bug in Qt4.3.3 QXmlSimpleReader::reset() ?

    Could that be another reincarnation of bug #166278?

  4. #4
    Join Date
    May 2007
    Posts
    91
    Thanks
    60
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Bug in Qt4.3.3 QXmlSimpleReader::reset() ?

    Quote Originally Posted by jacek View Post
    Could that be another reincarnation of bug #166278?
    Yes I think so

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Bug in Qt4.3.3 QXmlSimpleReader::reset() ?

    Could you prepare a small compilable example that reproduces the problem?

  6. #6
    Join Date
    May 2007
    Posts
    91
    Thanks
    60
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Bug in Qt4.3.3 QXmlSimpleReader::reset() ?

    Quote Originally Posted by jacek View Post
    Could you prepare a small compilable example that reproduces the problem?
    Attatched is a small example reproduces the problem

    part of it
    Qt Code:
    1. QFile file("Resources/book.xml");
    2. QXmlInputSource inputSource(&file);
    3. Parser1 handler1;
    4. reader.setContentHandler(&handler1);
    5. reader.setErrorHandler(&handler1);
    6. reader.parse(inputSource);
    7.  
    8. // QXMLSimpleReader::reset() dosen't work
    9. //inputSource.reset();
    10.  
    11. //while QFile::seek(0) works
    12. file.seek(0);
    13.  
    14. Parser2 handler2;
    15. reader.setContentHandler(&handler2);
    16. reader.setErrorHandler(&handler2);
    17. reader.parse(inputSource);
    To copy to clipboard, switch view to plain text mode 
    Attached Files Attached Files
    Last edited by Shawn; 28th February 2008 at 09:39.

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Bug in Qt4.3.3 QXmlSimpleReader::reset() ?

    I've just tested it and indeed it doesn't work on Qt 4.3.3. Please send that to the Trolls (qt-bugs @ ... ), so that they can fix it (I would just add a small comment that working version doesn't output anything and the broken one displays a message box).

  8. #8
    Join Date
    May 2007
    Posts
    91
    Thanks
    60
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Bug in Qt4.3.3 QXmlSimpleReader::reset() ?

    Quote Originally Posted by jacek View Post
    I've just tested it and indeed it doesn't work on Qt 4.3.3. Please send that to the Trolls (qt-bugs @ ... ), so that they can fix it (I would just add a small comment that working version doesn't output anything and the broken one displays a message box).
    Thank you. Do you think the example is clear enough to confirm that it is a bug?

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Bug in Qt4.3.3 QXmlSimpleReader::reset() ?

    Quote Originally Posted by Shawn View Post
    Do you think the example is clear enough to confirm that it is a bug?
    Well... you could minimize it a bit further.

    I've just made a simple test and changed main.cpp like this:
    Qt Code:
    1. { // <--- added {
    2. Parser1 handler1;
    3. reader.setContentHandler(&handler1);
    4. reader.setErrorHandler(&handler1);
    5. reader.parse(inputSource);
    6. } // <--- added }
    To copy to clipboard, switch view to plain text mode 
    and the problem still occurs.

    reset() looks like this:
    Qt Code:
    1. void QXmlInputSource::reset()
    2. {
    3. d->nextReturnedEndOfData = false;
    4. d->pos = 0;
    5. }
    To copy to clipboard, switch view to plain text mode 
    so obviosly it doesn't touch the file.

  10. #10
    Join Date
    May 2007
    Posts
    91
    Thanks
    60
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Bug in Qt4.3.3 QXmlSimpleReader::reset() ?

    Sorry for late but I just found some time ...
    I've report it as a bug to Trolltech.

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.