Qt console qtcreator_process_stub (xterm) does not display Chinese.

Source: Internet
Author: User

When you use qt's qtcreator to create a pure C/C ++ project, QT calls a console, similar to the console in windows. By default, Chinese characters are not displayed, nnd. Google has no solution.

Asking for help is better than asking for help! Remember that when you started the QT console, QT prompts that there is no xterm. That is to say, the console of QT call is xterm, refer to the two articles of xterm configuration: http://blog.sina.com.cn/s/blog_6a75ed3d0100p10b.html

Http://tieba.baidu.com/p/1798593957

The xterm configuration file is in a file named Xresources. First, switch to root, and then locate Xresources. The file path is:/etc/X11/Xresources;

 

[Root @ localhost ~] # Gedit/etc/X11/Xresources
When enabled, the default configuration content is:

! 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: hintmediumXft.hinting: true

After my verification, you can add a sentence above:

Xterm * facename: monospace: antialias = true: pixelsize = 15

Run: [root @ localhost ~] # Xrdb/etc/X11/Xresources
Make the configuration file take effect so that the qtcreator_process_stub of QT can display Chinese normally!

However, at this time, the jump-out console is too wide and not beautiful. Add the setting width and height:

Xterm * geometry: 50x24

That is, the width is 50, and the height is 24.

For the sake of insurance, add this sentence:

Xterm * facenamedoublesize: wenquanyi Zen Hei: antialias = true: pixelsize = 15

This is to set the font. The system's wenquanyi is used. It comes with the system!

Summary: The added configuration statement contains the following red sentences. After modification, you must # xrdb/etc/X11/Xresources.


! Font and locale

! Xterm * locale: True
! Xterm. utf8: True
! Xterm * utf8title: True
 
! Xterm * fontmenu * fontdefault * label: Default

Xterm * geometry: 50x24
Xterm * facename: monospace: antialias = true: pixelsize = 15

! Xterm * boldfont: sans: Style = bold: pixelsize = 13
Xterm * facenamedoublesize: wenquanyi Zen Hei: antialias = true: pixelsize = 15
! Xterm * xftantialias: True
! Xterm. cjkwidth: True
! Xterm * preedittype: Root

With! Is blocked. You can configure it as needed.

Previous:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.