Results 1 to 4 of 4

Thread: QString to char *

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Sep 2009
    Posts
    4

    Default Re: QString to char *

    Quote Originally Posted by barrygp View Post
    ---------------
    Works:

    QString s = QString(tr("whatever"));

    std::string str = std::string(s.toAscii().data());
    const char * asdfasdf = str.c_str();


    qDebug(asdfasdf);
    here you have created a std::string str and asdfasdf = str.c_str() is available at qDebug(asdfasdf).
    Last edited by zhnde; 4th September 2009 at 20:24.

Similar Threads

  1. Char array[6] to QString and display it
    By arunvv in forum Newbie
    Replies: 11
    Last Post: 12th March 2014, 20:48
  2. File rename detection
    By bunjee in forum Qt Programming
    Replies: 6
    Last Post: 23rd July 2009, 15:22
  3. Converting QString to char array
    By srohit24 in forum Qt Programming
    Replies: 3
    Last Post: 22nd July 2009, 18:19
  4. QString to unsigned char *
    By darksaga in forum Qt Programming
    Replies: 9
    Last Post: 23rd July 2007, 07:52
  5. Convert from iso-8859-1 to... Something else :-)
    By Nyphel in forum Qt Programming
    Replies: 4
    Last Post: 7th March 2007, 17:59

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.