QString::toWCharArray(wchar_t * array)

其中 wchar_t * array 除了要分配内存之外,必须用 wmemset 初始化。

环境是 Visual Studio 2015.

QT官方文档确实注明了:Note: This function does not append a null character to the array.

另一种转换方法

auto archiveWString = mArchive.toStdWString();
auto archive = const_cast<wchar_t *>(archiveWString.c_str());

出处:VRonin https://forum.qt.io/topic/92621/convert-qstring-to-wchar_t/20

最新文章

  1. CentOS7 Tomcat 环境部署
  2. HTML 表单和输入&lt;form&gt;&lt;input&gt;
  3. MQTT协议学习笔记
  4. DOM笔记整理及应用实例
  5. QQ拼音在中文输入下默认英文标点
  6. EIGRP汇总
  7. spring中的ResourceBundleMessageSource
  8. python xlrd对excel的读取功能
  9. 枚举+搜索 hdu-4431-Mahjong
  10. jQuery复习:第四章
  11. NBUT 1120 线段树
  12. Ubuntu16.04下安装Chrome出现“未安装软件包 libappindicator1”问题的解决办法
  13. python(day16)内置函数,匿名函数
  14. python使用协程并发
  15. java ssl 使用不同的加密套件,对性能影响很大
  16. BZOJ.4766.文艺计算姬(Prufer)
  17. linux下grep命令详解
  18. JAVA 画图板实现(基本画图功能+界面UI)二、功能实现及重绘实现
  19. 【hbuilder】如何根据Geolocation获得的坐标获取所在城市?
  20. 兼容主流浏览器的css渐变色

热门文章

  1. XDebug的配置和使用
  2. linux中的bash
  3. Vue 【前端面试题】
  4. [WPF]是时候将WPF控件库从.Net Framework升级到.NET Core 3.1
  5. D. Little Artem and Dance(带环模拟 + 规律)
  6. SpringBoot整合Springfox-Swagger2
  7. Python GUI——tkinter菜鸟编程(中)
  8. 适用于小白的 python 快速入门教程
  9. Redis cluster集群配置教程
  10. 004-流程控制-C语言笔记