Results 1 to 20 of 27

Thread: How to convert QString to std::string or char*?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Dec 2007
    Posts
    628
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    3
    Thanked 89 Times in 87 Posts

    Default Re: How to convert QString to std::string or char*?

    Quote Originally Posted by yangyunzhao View Post
    But in my program ,I use a third party API. The third party API request a std::string or char* parameter.
    Try:
    Qt Code:
    1. string->toUtf8()->data();
    To copy to clipboard, switch view to plain text mode 
    Last edited by yogeshgokul; 24th August 2009 at 07:29.

Similar Threads

  1. Getting std::string object from QString object ( qt3)
    By joseph in forum Qt Programming
    Replies: 11
    Last Post: 28th March 2013, 20:09
  2. convert from QString to char[sizeof(...)]
    By adamatic in forum Qt Programming
    Replies: 4
    Last Post: 3rd September 2011, 09:05
  3. convert QString to QByteArray
    By morgana in forum Qt Programming
    Replies: 5
    Last Post: 2nd March 2011, 13:33
  4. File rename detection
    By bunjee in forum Qt Programming
    Replies: 6
    Last Post: 23rd July 2009, 15:22
  5. convert QString to int
    By mattia in forum Newbie
    Replies: 2
    Last Post: 4th January 2008, 09:10

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.