QString processName = "test.exe";
QString::toWCharArray(processName);
我收到以下错误:
error: C2664: 'QString::toWCharArray' : cannot convert parameter 1 from 'QString' to 'wchar_t *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
原文由 user2317537 发布,翻译遵循 CC BY-SA 4.0 许可协议
你使用不正确。您应该在
toWCharArray
QString
您想要转换并将其传递给您已分配的数组的第一个元素的指针:这用
array
processName
。