Results 1 to 10 of 10

Thread: QString to unsigned char *

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #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: QString to unsigned char *

    Do it with QString::toAscii().constData().
    It returns a preallocated (const char *) and it is frequently used for these situations.

    Qt Code:
    1. char *sequence = string.toAscii().constData();
    To copy to clipboard, switch view to plain text mode 

    Regards

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

    darksaga (21st July 2007)

Similar Threads

  1. Convert from iso-8859-1 to... Something else :-)
    By Nyphel in forum Qt Programming
    Replies: 4
    Last Post: 7th March 2007, 17:59
  2. QString to Char
    By kenny_isles in forum Newbie
    Replies: 1
    Last Post: 23rd February 2007, 09:51
  3. QString to const char
    By TheRonin in forum Newbie
    Replies: 2
    Last Post: 12th February 2007, 14:43
  4. unable to save QCStrings properly in a buffer
    By nass in forum Qt Programming
    Replies: 13
    Last Post: 15th November 2006, 20:49
  5. QString to char
    By boss_bhat in forum Qt Programming
    Replies: 7
    Last Post: 20th July 2006, 23:26

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.