The solution to Qt's inability to input Chinese in Ubuntu

Reprinted from http://blog.csdn.net/u013812682/article/details/52101088#comments
I have installed a lot of Qt versions, but I will encounter the problem of not being able to input Chinese, but they are all encountered in fcitx, it is possible to use ibus To input Chinese, here I use fcitx, Sogou input method, we will not discuss the specific reasons, let's take a look at the solution.

First install fcitx-frontend-qt5

  • sudo apt-get install fcitx-frontend-qt5

This seems to be installed by default, and then check the installation directory of fcitx-frontend-qt5.

  • dpkg -L fcitx-frontend-qt5

As shown in the figure:
write picture description here

Usually this

/usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so

Then copy this library to the installation directory

~$: sudo cp /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so  /home/userhome/Qt5.3.1/5.3/gcc_64/plugins/platforminputcontexts
~$: sudo cp /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so  /home/userhome/Qt5.3.1/Tools/QtCreator/bin/plugins/platforminputcontexts/

At this point, it is completed, restart qtcreator and you can use the Chinese input method.

Supplement: Qt5.7 installed today,

The second copy directory is changed to: ~/Qt5.7.0/Tools/QtCreator/lib/Qt/plugins/platforminputcontexts

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325566961&siteId=291194637