Results 1 to 3 of 3

Thread: QByteArray can not support unsigned char?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2009
    Location
    Gdansk, Poland
    Posts
    11
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    7

    Default QByteArray can not support unsigned char?

    I want read binary file and load data to unsigned char array. My code is:
    Qt Code:
    1. QFile f("a.a");
    2. f.open(QFile::ReadOnly);
    3. QByteArray d = f.readAll();
    4. f.close();
    To copy to clipboard, switch view to plain text mode 
    Functions from QFile and QByteArray support only signed char not unsigned char. I can not understand reason for using signed char because for me byte=unsigned char.
    Is there any possibility to read unsigned char from file? Of course I can convert every signed char to unsigned char but mayby exsist easier way for this problem?
    Last edited by olosie; 4th March 2010 at 12:22.

Similar Threads

  1. Creating a pixmap from unsigned char*
    By winder in forum Qt Programming
    Replies: 9
    Last Post: 6th July 2021, 13:56
  2. convert from unsigned char* to QString
    By bhaskar in forum Qt Programming
    Replies: 2
    Last Post: 12th February 2010, 06:36
  3. unsigned char * to QString
    By elina.du in forum Qt Programming
    Replies: 2
    Last Post: 25th March 2009, 08:33
  4. Conversion from unsigned char* to unsigned char
    By santosh.kumar in forum General Programming
    Replies: 1
    Last Post: 6th August 2007, 13:12
  5. QString to unsigned char *
    By darksaga in forum Qt Programming
    Replies: 9
    Last Post: 23rd July 2007, 07:52

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.