日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Ubuntu >内容正文

Ubuntu

ubuntu Qt Creator不能输入中文

發布時間:2025/3/8 Ubuntu 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ubuntu Qt Creator不能输入中文 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

ubuntu Qt Creator不能輸入中文

解決方式為下面的腳本,如果你的Qt是安裝在根目錄下,那么需要加sudo,如果不是,直接運行即可

sudo bash ChineseInputForQt-v1.1.sh# 或者bash ChineseInputForQt-v1.1.sh

腳本內容為:

#! /bin/bash #------------------------------------------------------------------------------ # Filename: chineseForQt.sh # Usage: ./chineseForQt.sh # Version: 1.0 # Date: 2017-45-04 # Author: vincent # Email: N/A # Description: N/A # Notes: N/A # 解決Qt中不能輸入中文的問題 # 支持ubuntu 16.04,ubuntu 18.04,linux mint #------------------------------------------------------------------------------- # 查找Qt的安裝目錄installPath=$(ls /usr/share/applications/ | grep -x "DigiaQt-qtcreator-community.desktop" )ExecStr=""if [ -z "$installPath" ] theninstallPath=$(ls /usr/share/applications/ | grep -x "DigiaQt-qtcreator-enterprise.desktop")if [ -z "$installPath" ]theninstallPath=$(ls /usr/share/ubuntu/applications/ | grep -x "DigiaQt-qtcreator-enterprise.desktop")if [ -z "$installPath" ]thenecho "Qt Creator is not installed !!!"exit 1elseExecStr=$(grep Exec /usr/share/ubuntu/applications/$installPath)fielseExecStr=$(grep Exec /usr/share/applications/$installPath)fi fiExecStr=$(echo ${ExecStr#*=}) ExecStr=$(echo ${ExecStr%/Tools*}) installPath=$ExecStrdeclare USER=$(who | awk '{print $1}') declare QT_VERSION=$(echo ${installPath#*Qt})folderName=$(echo -e "${QT_VERSION%.*}") # 去除數字 如5.9.0去除 .0folderArray=($(ls $installPath))for(( i=0; i < ${#folderArray[@]}; i++ )) doif [[ ${folderArray[$i]} == $folderName* ]]thenfolderName=${folderArray[$i]}breakfi donedeclare libName="libfcitxplatforminputcontextplugin.so" declare sourceFilePath="/usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/$libName" declare destFolderPath="$installPath/Tools/QtCreator/lib/Qt/plugins/platforminputcontexts/" declare dstFolderAnotherPath="$installPath/$folderName/gcc_64/plugins/platforminputcontexts/"outputMsg() {if [ $1 -ne 0 ]thenecho "unsuccessful !!"exit 1fi }#sudo -s sudo apt-get install -y fcitx-libs-qt5 > /dev/nullsudo cp $sourceFilePath $destFolderPath outputMsg $? sudo chown $USER:$USER ${destFolderPath}$libName outputMsg $? chmod 777 ${destFolderPath}$libName outputMsg $?sudo cp $sourceFilePath $dstFolderAnotherPath outputMsg $? sudo chown $USER:$USER ${dstFolderAnotherPath}$libName outputMsg $? chmod 777 ${dstFolderAnotherPath}$libName outputMsg $?echo "Successful! You can do it!"

總結

以上是生活随笔為你收集整理的ubuntu Qt Creator不能输入中文的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。