Results 1 to 10 of 10

Thread: qt binary file writing and reading

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #9
    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: qt binary file writing and reading

    Since you decided to work with strings rather than bits you need to convert your code string into a packed set of bytes containing those bits. You need to determine how to deal with the incomplete byte you are likely to have at the end (perhaps pad with zeroes and record the number of padding bits as the first three bits of the output). The order of bit packing in bytes is important if your code is not the decoder. Then write the resulting bytes to file with QIODevice::write().

    A compact way to represent the dictionary is more complex, and you should try to walk before you run.
    http://www.siggraph.org/education/ma..._tutorial.html

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

    seniorc (17th December 2013)

Similar Threads

  1. Writing my own object to a binary file.
    By 8Observer8 in forum Newbie
    Replies: 1
    Last Post: 1st December 2013, 08:15
  2. Reading a binary file with QT
    By YuriyRusinov in forum Qt Programming
    Replies: 7
    Last Post: 21st December 2012, 07:14
  3. Reading/writing data to binary file
    By DiamonDogX in forum Qt Programming
    Replies: 3
    Last Post: 23rd July 2009, 19:24
  4. Binary file Reading.........
    By umulingu in forum Qt Programming
    Replies: 11
    Last Post: 20th July 2009, 06:18
  5. reading/writing to file
    By QiT in forum Newbie
    Replies: 2
    Last Post: 11th August 2006, 17:21

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.