Convert WCHAR to QString in Qt. Please help me to implement it to complete this convertion.
Asked
Active
Viewed 3.0k times
1 Answers
31
There are to/from WCharArray
methods that are static members of QString
:

demonplus
- 5,613
- 12
- 49
- 68

HostileFork says dont trust SE
- 32,904
- 11
- 98
- 167
-
It looks like these links are broken – Shafik Yaghmour Mar 22 '13 at 20:36
-
1@ShafikYaghmour Thanks for the heads-up. Fixed 'em. But I sure wish these guys would have read Tim's [Cool URIs don't change](http://www.w3.org/Provider/Style/URI.html). :-/ – HostileFork says dont trust SE Mar 31 '13 at 16:21
-
You might want to consider editing to include an example as well. – Shafik Yaghmour Mar 31 '13 at 16:43
-
`QString::fromUtf16()` also works. I was getting linking errors in QT 5 on using `QString::fromWCharArray()`. see https://forum.qt.io/post/165335. Linking error I was getting - `unresolved external symbol "__declspec(dllimport) public: static class QString __cdecl QString::fromWCharArray(unsigned short const *,int)" (__imp_?fromWCharArray@QString@@SA?AV1@PBGH@Z)` – Sahil Singh Dec 07 '20 at 18:41