Convert from 'QChar' to 'wchar_t'

I need to pass QChar to a function that expects wchar_t:

void myFunc(wchar_t wch);

Trying to just pass a QCharfailure with an error:

error: C2664: 'myFunc' : cannot convert parameter 1 from 'QChar' to 'wchar_t'
+4
source share
1 answer

Found the answer, even when I asked the question, I needed to use QChar :: unicode () .

wchar_t wch = qch.unicode();
+4
source

All Articles