I use QString::fromWCharArray(wchar_t*) to assign a wchar_t array to QString but the QString always is empty.
Here is my code:
The result is test = "". My expectation is test = "abc".Qt Code:
wchar_t * temp = new wchar_t[4]; temp[0] = 'a'; temp[1] = 'b'; temp[3] = 'c'; temp[4] = 0; QString test; test.fromWCharArray(temp);To copy to clipboard, switch view to plain text mode
I appreciate very much if anyone could tell me what's wrong.
Many thanks in advance.
Bookmarks