Results 1 to 3 of 3

Thread: How can I read Binary files with Qt

  1. #1
    Join Date
    Jun 2007
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How can I read Binary files with Qt

    Hi

    how Can I read Binary File with Qt "QDataStream ()"

    what I want is the code witch reading the binary files Byte by Byte



    thanks,

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How can I read Binary files with Qt

    The code is fairly easy.
    You have to use QDataStream::readRawBytes(const char*, int).

    The QDataStream has to be initialized with a QIODevice, either in the constructor or with setDevice. You will have to pass an opened QFile here.

    But I don't suggest reading the data byte by byte, because it will take longer.
    You can read it in a buffer, and process it separately.

    Regards

  3. #3
    Join Date
    Jun 2007
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How can I read Binary files with Qt

    thanks very much

Similar Threads

  1. QIODevice read()
    By ShaChris23 in forum Newbie
    Replies: 1
    Last Post: 3rd May 2007, 01:29
  2. Concatenating two binary files
    By nbkhwjm in forum Newbie
    Replies: 13
    Last Post: 23rd April 2007, 04:30
  3. read files and save the,
    By kernel_panic in forum Qt Programming
    Replies: 2
    Last Post: 4th January 2007, 07:31
  4. Read files PDF
    By henriquez0 in forum Qt Programming
    Replies: 3
    Last Post: 31st December 2006, 01:20
  5. [Win32/VC++ 8.0] Strange problems with qrc_*.cpp files
    By mloskot in forum Installation and Deployment
    Replies: 6
    Last Post: 6th March 2006, 11:28

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.