Results 1 to 9 of 9

Thread: can`t read a binary data!

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Join Date
    Dec 2006
    Posts
    849
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    6
    Thanked 163 Times in 151 Posts

    Default Re: can`t read a binary data!

    errorString() is a method of QFile's base class QIOStream.


    What do you mean a section of text and binary?
    Using QDataStream you will read binary data.

    Your code
    Qt Code:
    1. QDataSteam in(&file);
    2. QString inin;
    3. in >> inin;
    To copy to clipboard, switch view to plain text mode 
    will not read some ascii from a (text) file, but rather the serialized binary representation of a QString which is something entirely different.
    If you read ascii text with that code, interesting but unintended things will happen.

  2. The following user says thank you to caduel for this useful post:

    blm (18th September 2008)

Similar Threads

  1. How can I read binary data to QString?
    By zolookas in forum Newbie
    Replies: 2
    Last Post: 29th July 2008, 20:03
  2. Read binary file and convert to QString
    By jaca in forum Qt Programming
    Replies: 12
    Last Post: 13th June 2008, 23:05
  3. Read Data in formated manner
    By rajeshs in forum Qt Programming
    Replies: 1
    Last Post: 1st January 2008, 12:28
  4. Reading binary data
    By vermarajeev in forum Qt Programming
    Replies: 1
    Last Post: 13th August 2007, 09:14
  5. How to convert binary data to hexadecimal data
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 8th March 2006, 16:17

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.