Results 1 to 10 of 10

Thread: How to write and read from binary files

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: How to write and read from binary files

    If the files you are using as input are just being treated as a sequence of bytes then you do not need QDataStream, which is more aimed at providing an object serialisation system for Qt applications, you can just use the QIODevice interface directly.

    QString::number can convert a byte to its string representation in any base you like between 2 and 36.
    QString::toLong can do the opposite magic.

    Ultimately I am not sure how useful your experiment will be in getting to your end goal of graphing a data stream from another source.
    Last edited by ChrisW67; 23rd November 2011 at 03:31. Reason: spelling corrections

Similar Threads

  1. Replies: 2
    Last Post: 2nd November 2010, 05:15
  2. Using QT to read and write files over bluetooth FTP
    By deano in forum Qt Programming
    Replies: 0
    Last Post: 14th December 2009, 23:22
  3. Replies: 1
    Last Post: 27th August 2009, 05:41
  4. How can I read Binary files with Qt
    By geo_saleh in forum Qt Programming
    Replies: 2
    Last Post: 16th August 2007, 10:37
  5. How to read/write sets of orderded numbers in binary
    By kaydknight in forum General Programming
    Replies: 3
    Last Post: 12th March 2007, 05:50

Tags for this Thread

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.