Home > other >  How to convert a QString to LPCWSTR
How to convert a QString to LPCWSTR

Time:11-22

Such as topic, how to realize a QString LPCWSTR conversion, using QT4,

CodePudding user response:

QString WLPSTR=QString: : fromLocal8Bit (" I love you China!" );
STD: : wstring WLPSTR=m_findStr. ToStdWString ();
LPCWSTR LPCWSTR=WLPSTR. C_str ();
QString STR=QString: : fromStdWString (lpcwStr);
  • Related