环境
1、中标麒麟V7
2、系统自带的Qt Create 4.1.0(Based on Qt 5.9.2 (GCC 4.9.2 20141101 (NeoKylin 4.9.2-1), 64 bit))
3、.pro文件中配置了 CONFIG += console后控制台输不出中文的问题
解决方法
1、打开以下文件:
/etc/X11/Xresources
2、添加以下二行代码即可,其中字体“方正楷体_GBK”可执行 “fc-list”查看本机字体替换:
! This is the global resources file that is loaded when
! all users log in, as well as for the login screen
! Fix the Xft dpi to 96; this prevents tiny fonts
! or HUGE fonts depending on the screen size.
Xft.dpi: 96
! hintstyle: medium means that (for Postscript fonts) we
! position the stems for maximum constrast and consistency
! but do not force the stems to integral widths. hintnone,
! hintslight, and hintfull are the other possibilities.
Xft.hintstyle: hintmedium
Xft.hinting: true
!添加以下二行即可
xterm*faceNameDoublesize:方正楷体_GBK:antialias=True:pixelsize=15
xterm*faceName:Consolas:antialias=True:pixelsize=15
3、执行以下命令,重新加载一下
xrdb /etc/X11/Xresources
参考网址:
http://blog.sina.com.cn/s/blog_7bac5d250101hz6h.html
http://www.bubuko.com/infodetail-2635075.html
https://blog.youkuaiyun.com/weixin_33725239/article/details/89632928
在中标麒麟V7系统中,使用Qt Create 4.1.0(基于Qt 5.9.2)开发时遇到CONFIG += console配置后控制台无法输出中文的问题。解决方法包括修改Qt相关文件,添加支持中文的字体设置,如添加“方正楷体_GBK”,并执行命令重新加载字体。参考多个技术博客完成修复。
3249

被折叠的 条评论
为什么被折叠?



