当前位置:网站首页>Solution to qt5.12 unable to input Chinese (unable to switch Chinese input method) in deepin system

Solution to qt5.12 unable to input Chinese (unable to switch Chinese input method) in deepin system

2022-06-13 10:19:00 Just a little bit

One . What happened

         The process was installed yesterday deepin System to QT Development , Everything is going well , But when inputting Chinese , You can't input any switch , That is to say, the Chinese input method cannot be switched , The input method status changes to the default keyboard type and any operation of switching input methods does not work  . I had a headache all afternoon yesterday , Can't do it .

Two . Why is this problem ?

         For the use of fcitx Framework of the Chinese input method , Need to compile manually fcitx-qt5 Generate Chinese input method Library file ,qt There is no configuration in it , Need to be in qt You can only configure these files in some directories of .

         Check the information and see that many people use git clone github Download under fcitx-qt5.git, But my computer doesn't work

        git clone https://github.com/fcitx/fcitx-qt5.git

            After returning home, I will use my own computer to remotely log in to my Alibaba cloud server , Use this command remotely to download , When the download is complete , I copy the downloaded file to my computer , And then upload QQ mailbox .

         I put this plug-in directly under the network disk link : There is a problem like me , Just download it directly

         link : https://pan.baidu.com/s/1gP1LQr_W7lR9O7x4wcgYcA

         Extraction code : 8ypp 

         After returning to the company the next day , Log in right now QQ mailbox , take fcitx-qt5, Download to deepin In the system , Follow these steps to compile :

For the use of fcitx Chinese input method of frame ( Such as Sogou input method ), Need to compile manually fcitx-qt5 Generate the library file of Chinese input method

3、 ... and . How to solve it ?

1. install cmake, Used to compile fcitx-qt5

First, check whether it is installed cmake:

cmake --verison

If the version information is displayed, it indicates that it has been installed , Then you can go to the next step ; If not installed , First install :

sudo apt install cmake

2. install fcitx-libs-dev

sudo apt install fcitx-libs-dev

3. Download the fcitx-qt5 after , decompression fcitx-qt5

4. Get into fcitx-qt5 Unpack the directory

cd fcitx-qt5

5. Set up qmake environment variable

export PATH="$HOME/Qt/Qt5.12.0/5.12.0/gcc_64/bin":$PATH

Be careful : The specific path is determined according to your installation directory

6.  Generate makefile file

cmake .

If the result shown in the figure below appears , It was successful , You can skip the following steps

If something goes wrong , Pay attention to the error message

  For me, the file in the path shown in the figure is missing libcomposeplatforminputcontextplugin.so

Let's go directly to the system to find , See if there are... Anywhere else

use find command

find / -name libcomposeplatforminputcontextplugin.so

  And will find libcomposeplatforminputcontextplugin.so Copy the library file to , The error prompt is in the missing path

Re execution

cmake .

Look at the error prompt , What's less , Use... In the system directory find Just find the command , Until no error is reported , As shown in the figure below

That's what I mean cmake success , Successfully generated makefile file

7. compile

make

 

Can compile to 100%, The compilation is successful

  We see the ficitx-qt5 The catalog of , The discovery produced qt5 and qt6 Two files of two

  Because I'm using qt5.12.0 Version of Qt, So what I want to use is qt5 In the catalog libfcitxplatforminputcontextplugin.so The library files

 8. copy to Qt In the specified two directories

cp -f libfcitxplatforminputcontextplugin.so /home/yicaobao/Qt5.12.0/5.12.0/gcc_64/plugins/platforminputcontexts/
cp -f libfcitxplatforminputcontextplugin.so /home/yicaobao/Qt5.12.0/Tools/QtCreator/lib/Qt/plugins/platforminputcontexts

Be careful : The specific path is determined according to your installation directory

ok, Everything is open !

9. restart Qt, that will do

 

原网站

版权声明
本文为[Just a little bit]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/164/202206131006091354.html