Results 1 to 2 of 2

Thread: The best way to convert QString to char

  1. #1
    Join Date
    Sep 2016
    Posts
    78
    Thanked 1 Time in 1 Post
    Qt products
    Qt5

    Default The best way to convert QString to char

    Which is the most easy and best way?
    thx

  2. #2
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: The best way to convert QString to char

    Quote Originally Posted by davinciomare View Post
    Which is the most easy and best way?
    thx
    char using what encoding? That's what methods like QString::toLocal8Bit(), QString::toStdString(), and QString::toUtf8() (and others) do, but you have to know what encoding you desire.
    I write the best type of code possible, code that I want to write, not code that someone tells me to write!

Similar Threads

  1. convert char *string to QString
    By vinithr in forum Newbie
    Replies: 5
    Last Post: 19th April 2012, 01:22
  2. How to copy(convert) QString to char* ??
    By Gokulnathvc in forum Newbie
    Replies: 6
    Last Post: 20th April 2011, 03:57
  3. convert from unsigned char* to QString
    By bhaskar in forum Qt Programming
    Replies: 2
    Last Post: 12th February 2010, 07:36
  4. How to convert QString to std::string or char*?
    By yangyunzhao in forum Qt Programming
    Replies: 26
    Last Post: 26th August 2009, 07:52
  5. How to convert QString to char *
    By rajeshs in forum Qt Programming
    Replies: 7
    Last Post: 27th September 2007, 11:32

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.