Cannot Use Chinese Input on Qpdfview (or All Qt Apps?)

Post Reply
miltonx
Posts: 160
Joined: Sat Nov 28, 2020 12:04 am
Has thanked: 13 times
Been thanked: 6 times

Cannot Use Chinese Input on Qpdfview (or All Qt Apps?)

Post by miltonx »

I tried fcitix and yong (20.0.0s and 18.0.51) on fossapup64_95. They work pretty well most of the time, but I found they cannot be activated on Qpdfview. To test this, try opening a pdf file on qpdfview, click any input area on the tool bar, or press ctrl+f to bring up the text search tool. Fcitx and Yong do not work on these input boxes.

So far I have not tried scim and ibus.

I also did a similar test on Debian 10.6, installed fcitx and qpdfview from Debian's official repo. Fcitx is able to input Chinese in Qpdfview's text search box.

Last edited by miltonx on Wed Sep 22, 2021 12:36 pm, edited 1 time in total.
icake
Posts: 446
Joined: Mon Jul 27, 2020 8:07 am
Been thanked: 45 times

Re: Cannot Use Chinese Input on Qpdfview

Post by icake »

Thanks for sharing your experience with the Chinese input on fossapup64_9.5.

Because linux systems and applications are put together without any test on whether they can fully support Chinese. Therefore the Chinese pets will work on most but not all applications.

I have limited experience with the fossapup64_9.5 system and knows nothing about qpdfview. I wonder if any other forum members who are more familiar with fossapup64_9.5 and qpdfview can help on this issue?

icake

miltonx
Posts: 160
Joined: Sat Nov 28, 2020 12:04 am
Has thanked: 13 times
Been thanked: 6 times

Re: Cannot Use Chinese Input on Qpdfview (or All Qt Apps?)

Post by miltonx »

Further testing of Yong showed same problem with QtNote. Seems that Yong does not work well with Qt apps?
(Haven't tested fcitx.)

miltonx
Posts: 160
Joined: Sat Nov 28, 2020 12:04 am
Has thanked: 13 times
Been thanked: 6 times

Re: Cannot Use Chinese Input on Qpdfview (or All Qt Apps?)

Post by miltonx »

I did some googling and found a post from Yong's website:
http://yong.dgod.net/read.php?tid=1987
(This site is often inaccessible. When that happens, I resort to google's cache page. Try googling "小小输入法 QT" and you will see that page.)
Reading dgod's posts, I confirmed that there is problem with QT.
Following his advice, I downloaded the qt lib file from:
http://yongim.ys168.com/
In the QT5 directory.
I downloaded libyongplatforminputcontextplugin.so (38.8KB5.5.1 64) and put it in /usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/.
(There are different QT versions for this file - libyongplatforminputcontextplugin.so, but I only tried this one.)
Then open a terminal, run:

Code: Select all

export GTK_IM_MODULE=yong
export QT_IM_MODULE=yong

Please note that this is different from what icake inserted in .xinitrc

Code: Select all

export GTK_XIM_MODULES="yong"
export QT_XIM_MODULES="yong"

I don't understand the difference between XIM and IM. Will research it later.
Then, keep this terminal open, and run a QT program from that same terminal (so that these exported environment variables are inherited), such as "qtnote", and Yong works. I also tested it for qpdfview.
At this moment I have not tried modifying the .xinitrc file to automatically export these variables on startup, because I can't wait to read some linux input method stuff, which is a huge pain in the ass and something irresistable for me to learn.

miltonx
Posts: 160
Joined: Sat Nov 28, 2020 12:04 am
Has thanked: 13 times
Been thanked: 6 times

Re: Cannot Use Chinese Input on Qpdfview (or All Qt Apps?)

Post by miltonx »

OK, did it in .xinitrc:
Make your .xinitrc's input method variables part look like this:

Code: Select all

...
	export  XIM="yong"
	export  XIM_ARGS="-d"
	export  XIM_PROGRAM="yong"
	export GTK_XIM_MODULES="yong"
	export QT_XIM_MODULES="yong"   (Maybe this line is not needed, but I didn't test.)
	#export GTK_IM_MODULE="yong"  (Comment out or delete this line, otherwise you will not be able to input in GTK programs)
	export QT_IM_MODULE="yong"      (This line is the key to make yong work on QT programs)
	eval `dbus-launch --sh-syntax --exit-with-session`
	export XMODIFIERS="@im=yong"
	export LC_CTYPE="zh_CN.utf8"
	sleep 5
	yong &
...

In effect, this is just one line added to icake's insersion, ie, export QT_IM_MODULE="yong".

icake
Posts: 446
Joined: Mon Jul 27, 2020 8:07 am
Been thanked: 45 times

Solved: Cannot Use Chinese Input on Qpdfview (or All Qt Apps?)

Post by icake »

Thanks for sharing.

Post Reply

Return to “Standard Chinese Language PET's”