环境
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: