Convert QString into std::string
General and Desktop
7
Posts
6
Posters
12.6k
Views
1
Watching
-
If you look at the "FAQs":http://developer.qt.nokia.com/faq/answer/how_can_i_convert_a_qstring_to_char_and_vice_versa you find something about string conversion
-
You can use the conversion "toStdString":http://doc.qt.nokia.com/4.7/qstring.html#toStdString
Typically I am using the std::string since I have other classes which are relying on stl. QString is in my software only with GUI used. The conversion works without problems.
However, you have to make sure that Qt is configured with -stl in order to have the stl support. -
"This":http://developer.qt.nokia.com/faq/answer/how_can_i_convert_a_qstring_to_char_and_vice_versa is the FAQ you need to reference.