Results 1 to 3 of 3

Thread: Reading an HEX file and store into a QByteArray

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,540
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Reading an HEX file and store into a QByteArray

    You have to use QFile not QTextStream.

  2. #2
    Join Date
    Nov 2009
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Reading an HEX file and store into a QByteArray

    Thanks,

    I removed the QTextStream and also I had to change this line to work:

    Qt Code:
    1. if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
    2. return;
    To copy to clipboard, switch view to plain text mode 

    To this:

    Qt Code:
    1. if (!file.open(QIODevice::ReadOnly))
    2. return;
    To copy to clipboard, switch view to plain text mode 


    Thanks a lot!

Similar Threads

  1. reading wrong data from QByteArray
    By avanindra in forum Qt Programming
    Replies: 3
    Last Post: 23rd February 2013, 13:06
  2. qbytearray qdatastream qfile writing/reading
    By pekal in forum Qt Programming
    Replies: 2
    Last Post: 26th October 2012, 21:51
  3. store number in QByteArray
    By sattu in forum Qt Programming
    Replies: 2
    Last Post: 20th January 2011, 13:27
  4. Reading from QByteArray
    By Misenko in forum Qt Programming
    Replies: 1
    Last Post: 30th September 2008, 16:17
  5. Reading QByteArray from QDataStream Qt3.3
    By high_flyer in forum Qt Programming
    Replies: 2
    Last Post: 1st April 2006, 20:23

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.