2013-04-04 534 views

回答

1

答案從這裏直接複製:

How to convert QString to std::string?

QString qs; 

// Either this if you use UTF-8 anywhere 
std::string utf8_text = qs.toUtf8().constData(); 

// or this if you on Windows :-) 
std::string current_locale_text = qs.toLocal8Bit().constData(); 
相關問題