Unable to input Chinese (Chinese characters) ?
-
wrote on 31 Jan 2021, 20:26 last edited by
Qt for WebAssembly currently does not support using local (system) fonts.
https://bugreports.qt.io/browse/QTBUG-81736You can add fonts to a resource file or download the fonts into the platform sandbox and then use
QFontDatabase::addApplicationFont or
QFontDatabase::addApplicationFontFromData(b) to load the font.You can then pick your font from the font chooser.
That part would work. Whether it will display correctly and be able to actually input might be a hit and miss right now. I have not been able to test font handling lately.
-
Qt for WebAssembly currently does not support using local (system) fonts.
https://bugreports.qt.io/browse/QTBUG-81736You can add fonts to a resource file or download the fonts into the platform sandbox and then use
QFontDatabase::addApplicationFont or
QFontDatabase::addApplicationFontFromData(b) to load the font.You can then pick your font from the font chooser.
That part would work. Whether it will display correctly and be able to actually input might be a hit and miss right now. I have not been able to test font handling lately.
wrote on 2 Feb 2021, 03:56 last edited by@lorn-potter Thank you very much.
I know how to display Chinese characters normally:int fontId = QFontDatabase::addApplicationFont(QStringLiteral(":/fonts/msyh.ttf")); QStringList fontFamilies = QFontDatabase::applicationFontFamilies(fontId); if ( fontFamilies.size() >0 ) { QFont font; font.setFamily(fontFamilies[0]); app.setFont(font); }
But ...
Just can't input Chinese characters
The problem made it impossible for me to start Chinese software. @_@ -
@lorn-potter Thank you very much.
I know how to display Chinese characters normally:int fontId = QFontDatabase::addApplicationFont(QStringLiteral(":/fonts/msyh.ttf")); QStringList fontFamilies = QFontDatabase::applicationFontFamilies(fontId); if ( fontFamilies.size() >0 ) { QFont font; font.setFamily(fontFamilies[0]); app.setFont(font); }
But ...
Just can't input Chinese characters
The problem made it impossible for me to start Chinese software. @_@wrote on 26 May 2022, 13:26 last edited by@Jonix-King 解决了吗?不能输入的问题点在哪里?是否可以通过修改qt源代码的方式进行支持?
-
wrote on 31 May 2022, 04:10 last edited by wenqing zhong
what do you mean "can't input Chinese characters"?
Cannot input chinese words when run in web-browser? I never meet that situation.
Cannot input chinese words in QT creator linux? May be, but you can find solution in the network. In windows, never heard of such problem. -
wrote on 1 Jun 2022, 04:50 last edited by
No, I am wrong! that is really a fatal problem. Line edit in wasm can only input english and number, but not Chinese characters. Now I can only paste the Chinese words to input widget. That is realy a nightmare.
-
@Jonix-King 解决了吗?不能输入的问题点在哪里?是否可以通过修改qt源代码的方式进行支持?
wrote on 3 Jan 2023, 01:26 last edited by@jineter 已知唯一解决方案是在WASM中自己做一个输入法。已经有人搞出了虚拟键盘+拼音输入,据说可以满足需求。由于不肯开源只看到了截图。em编译器的说明中没有看到输入法限制方面的说明,无法判断是否是em的原因所致;但感觉Qt自身原因的可能性更大一些。
-
@jineter 已知唯一解决方案是在WASM中自己做一个输入法。已经有人搞出了虚拟键盘+拼音输入,据说可以满足需求。由于不肯开源只看到了截图。em编译器的说明中没有看到输入法限制方面的说明,无法判断是否是em的原因所致;但感觉Qt自身原因的可能性更大一些。
wrote on 18 May 2023, 12:58 last edited by@Jonix-King You can derive a custom Edit widget from QLineEdit, replace the subclass original QLineEdit, and solve Chinese input.
-
@jineter 已知唯一解决方案是在WASM中自己做一个输入法。已经有人搞出了虚拟键盘+拼音输入,据说可以满足需求。由于不肯开源只看到了截图。em编译器的说明中没有看到输入法限制方面的说明,无法判断是否是em的原因所致;但感觉Qt自身原因的可能性更大一些。
wrote on 19 May 2023, 03:28 last edited by@Jonix-King 是不是无法在Qt界面中唤出中文输入法?如果是Linux平台可能和fcitx之类的输入法框架相关,印象中输入法是由输入法框架唤起的
-
@Jonix-King You can derive a custom Edit widget from QLineEdit, replace the subclass original QLineEdit, and solve Chinese input.
wrote on 2 Jun 2023, 03:15 last edited by@Guo-Tao Can you prompt for sample source code?
-
@Jonix-King 是不是无法在Qt界面中唤出中文输入法?如果是Linux平台可能和fcitx之类的输入法框架相关,印象中输入法是由输入法框架唤起的
wrote on 2 Jun 2023, 03:26 last edited by@Wei-Wei 我知道Linux平台是需要有外部插件提供支持的,但是浏览器估计原理并不不相同吧。看说明是由于安全性原因的限制
-
wrote on 2 Jun 2023, 06:00 last edited by JasonWong 6 Feb 2023, 06:04
测试了,6.5.1版本也无法输入中文。
看网上有说输入的时候在html那边生成一个输入框,生成完成后再把文本传到qt这里。另外,虽然6.5.1的release说明说修复了中文输入问题,但是我看实际的bug还没关闭,要等待6.5.2
https://bugreports.qt.io/browse/QTBUG-107139 -
wrote on 24 Jul 2023, 02:57 last edited by JasonWong
经测试,6.5.2任然存在无法输入中文的问题,这是我的测试项目
After testing, the issue of unable to input Chinese still exists in 6.5.2, this is my test project.
https://web.jasonserver.com:10035/JQText/JQText.html
https://github.com/188080501/JQWeb -
wrote on 5 Sept 2023, 10:43 last edited by
Will the bug fix of https://bugreports.qt.io/browse/QTBUG-107139 fix "accents" input in Linux desktop?
In Windows they work well, something like "é" works just fine, but in Linux they don't work, it will just display "e".
This in a QLineEdit.
In a portuguese keyboard "é" is inputted with '´' followed by 'e'.
If this issue is not related please let me know and I will create a separate bug for it. @lorn-potter
-
经测试,6.5.2任然存在无法输入中文的问题,这是我的测试项目
After testing, the issue of unable to input Chinese still exists in 6.5.2, this is my test project.
https://web.jasonserver.com:10035/JQText/JQText.html
https://github.com/188080501/JQWebwrote on 18 Dec 2023, 09:54 last edited by@JasonWong 我已经绝望的放弃WASM了~~~
-
@JasonWong 我已经绝望的放弃WASM了~~~
wrote on 19 Dec 2023, 06:32 last edited by@Jonix-King
估计修复最早也要6.5.4版本,但是我看还有几个分支没合并进去,这几天也没动静,估计又要等。我现在项目里work around就是调用web原生的输入框,就是操作起来有点麻烦。 -
wrote on 19 Dec 2023, 06:33 last edited by
无法输入中文,甚至某些情况下数字和英文输入都有问题。这已经无法满足一个基本程序的使用需求,还希望官网早点修复。
-
@JasonWong This is an english forum so please write in english or in the chinese subforum.
-
@JasonWong This is an english forum so please write in english or in the chinese subforum.
wrote on 19 Dec 2023, 07:03 last edited by@Christian-Ehrlicher The issue with Chinese input has not been fixed, which means some of the most basic functionalities of the programs are not met. In some cases, it is even impossible to input numbers and English. This makes it difficult to promote the wasm platform. I recommended it to my friends, and the common feedback is that it is unusable until this issue is resolved. The reported bugs have not been fixed and have not been merged into the dev or 6.5.4 versions. I wonder when it can be fixed, and I hope the official website can fix it as soon as possible.
-
wrote on 14 Aug 2024, 09:58 last edited by
In the latest version( 6.8.0 beta3 ), it's finally possible to input Chinese.
-
wrote on 6 Dec 2024, 07:41 last edited by
Really? This is so exciting
I'm going to install the experiment right away