Issue
I can't read or write any Russian text in a program written on Qt. All labels on Russian are blank, typing Cyrillic letters in QLineEdit has no effect.
Note all other programs works with Russian fine, even Qt Creator itself. In form design mode all labels are OK, but they disappear when I run a program.
Also Qt Linguist doesn't show Russian text
Image below shows a test program: Second line label contains Russian text, and QLineEdit at end too.
I tried qtconfig
. It works, font changes, but no Russian letters appeared
Configuration:
[email protected] ~ $ cat /proc/version
Linux version 3.13.0-24-generic ([email protected]) (gcc version 4.8.2 (Ubuntu
4.8.2-19ubuntu1) ) #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014
/etc/lsb-release
:
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=17
DISTRIB_CODENAME=qiana
DISTRIB_DESCRIPTION="Linux Mint 17 Qiana"
Qt: 4.8.6
.qmake.cache
:
CONFIG += debug largefile stl precompile_header mmx 3dnow sse sse2
sse3 ssse3 sse4_1 sse4_2 avx dylib create_prl link_prl depend_includepath
fix_output_dirs QTDIR_build
Solution
I added QFontDialog
and found that Qt has only ten ugly raster fonts, with Bitstream Character
as default. This topic said I need rebuild Qt with -fontconfig
option. Also I installed other recommended Qt for X11 requirements.
First ./configure
attempt reported a problem
QTextCodec: using KOI8-R, probe failed (e0 ce ru)
and this topic helped me:
$ localedef --no-archive -c -f KOI8-R -i ru_RU ru_RU.KOI8-R
My final script to build is:
sudo apt-get install libfontconfig1-dev libfreetype6-dev\
libx11-dev libxcursor-dev libxext-dev libxfixes-dev libxft-dev\
libxi-dev libxrandr-dev libxrender-dev
localedef --no-archive -c -f KOI8-R -i ru_RU ru_RU.KOI8-R
./configure -debug -opensource -shared -qt-sql-psql -nomake demos\
-nomake examples -gtkstyle -xrender -xrandr -xcursor -xfixes -fontconfig
make
sudo make install
Answered By - ILYA Answer Checked By - Mary Flores (WPSolving Volunteer)