Sogou input is a very popular input method. This input method is not installed by default on Ubuntu. Search the Internet and you’ll find different websites offering different methods. Some of them work, some of them don’t. Now, here I put my experience and installation steps to write down. Hopefully it will be helpful to developers. The Chinese input method is also very helpful for us to develop Chinese applications on Ubuntu Phone. With the Chinese input method installed, we can enter Chinese characters in Qt Creator and Scope test tools to develop our Chinese application.
\
1) Download “Sogou Input method for Linux”
\
We can go to the following website “pinyin.sogou.com/linux/” to download the newly released Sogou input method. Download the appropriate version according to your CPU bit.
\
\
\
We save the files in the default “Downloads” folder. Of course, you can also find a favorite folder to store the Debian file.
\
2) Install sogou input method debian file
First, we open the folder storing sogou input method, and double-click the file:
\
\
\
We can see that the system automatically calls the “Ubuntu Software Center” to install the sogoupinyin Software that has been downloaded. We wait for the installation to complete.
\
3) Install Ubuntu OS language support
Let’s start by opening Ubuntu OS Settings. Click the Settings icon at the top right of the screen.
\
\
\
Select System Settings… “. Then we can see the following screen:
\
\
\
Click the “Language Support” icon. You can see the following screen:
\
\
\
If you do not have Chinese installed on your system, please select Install/Remove Languages… To install support for Chinese. Select fcitx at the same time. The final image is:
\
\
\
4) Configure sogou Chinese input method
\
Reboot the system and click on the icon at the top right of the screen with the word “EN” :
\
\
\
Click the icon with the word “EN” in the upper right corner of the screen, or the icon with the keyboard.
\
\
Select the last “Text Entry” and click “+” to add sogou input method. Click “OK”. Restart the system.
\
5) Add Chinese support for Qt
Start Qt Creator. If you type Chinese characters in Qt Creator (Ctrl + Space) and no Chinese characters are displayed, we have to type the following command in Termnial
\
$ sudo apt-get install fcitx-frontend-qt5
Copy the code
So, restart Qt Creator. We can input Chinese characters.
\
\
\
6) Customize Qt Creator
Although above we have completed the installation of Chinese input method. Normally we use Ctrl+ Space to start the input method transition, however, in Qt Creator Ctrl+ Space has a special purpose. The specific description is as follows:
\
\
\
When we hit Ctrl+ Space, the properties of the item are displayed in the QML file. For most developers who are used to switching between Chinese input methods, we can change the Settings in Qt Creator to change the hotkeys for this feature.
\
\
\
If you don’t want to change the Settings in Qt Creator yourself, you can also try changing the way you switch input methods. Type in Terminal:
\
$ fcitx-config-gtk3
Copy the code
\
Do this by modifying the Settings in your app!
\
If the Sogou input method exits for some reason, you can run the following command to restart it without restarting your computer:
\
\
\
\
\
At this point. We have completed support for Qt Creator.
\
In the new SDK (Ubuntu-SDK-IDE), due to some SDK changes, all apps only rely on the Qt version installed in the SDK, so it has nothing to do with the system Qt. This causes sogou input method to not be used correctly in Qt Creator. If so, please refer to a bug I reported earlier. Specific solutions are as follows:
\
$ sudo apt-get install install fcitx-frontend-qt5
$ sudo sudo ln -s /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so /usr/ubuntu-sdk-ide/bin/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so
Copy the code
\
After doing the two commands above, restart Qt Creator.
\