Results 1 to 9 of 9

Thread: QDataStream interprets newline as end of file

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QDataStream interprets newline as end of file

    But are you sure you should be using QDataStream at all?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Mar 2012
    Location
    Germany
    Posts
    17
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QDataStream interprets newline as end of file

    Well, at least it makes my data unreadable.

    If the reading in general would fail, then I would use something different. However, it is working for one of my programs,
    so it can't be that wrong to use QDataStream.

    The error has to be somewhere else. I'll try to post a more detailed example later.
    :: Arch Linux KDE 4.9

  3. #3
    Join Date
    Mar 2012
    Location
    Germany
    Posts
    17
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QDataStream interprets newline as end of file

    It's getting interesting.

    When I do;
    Qt Code:
    1. for (int i = 0; i < size; i++) {
    2. while(!in.atEnd()) {
    3. in >> temp;
    4. qDebug() << temp << endl;
    5. }
    6. }
    To copy to clipboard, switch view to plain text mode 
    The entire file is being printed !!!

    I have to use two loops to get all data. How does that come ??!
    It's really strange, because it's working for the other program with only one loop.
    :: Arch Linux KDE 4.9

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,372
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QDataStream interprets newline as end of file

    Show us the whole function.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 6
    Last Post: 9th September 2011, 13:29
  2. Replies: 6
    Last Post: 24th November 2010, 18:59
  3. about newline
    By drizzlefsh in forum Qt Programming
    Replies: 1
    Last Post: 8th September 2009, 18:21
  4. QDataStream-serialization not writting to file
    By john_god in forum Qt Programming
    Replies: 4
    Last Post: 1st August 2009, 12:27
  5. Replies: 1
    Last Post: 16th October 2006, 07:25

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
  •  
Qt is a trademark of The Qt Company.