cht電腦資訊gcin
adm Find login register

在基於較新版qt 5.9.1的軟體中無法輸入中文

guest
1subject: 在基於較新版qt 5.9.1的軟體中無法輸入中文Promote 0 Bookmark 02017-11-22quote  

原本使用digikam 5.5.0及kdenlive 15.12.3( 基於qt 5.5.1),在安裝了gcin-qt5-immodule可正常輸入中文,最近試了一下最新版的digikam 5.7.0(基於qt 5.9.1)卻又發生無法輸入中文之現象,是否為現有的函式庫無法支援新版qt之故?

guest
2subject: Promote 0 Bookmark 02017-11-29quote  

根據 阿吉部落格 的說法,需要將 qt5-im/gcin-qt5.h 中的 IID 版本,改成 org.qt-project.Qt.QPlatformInputContextFactoryInterface.5.1

這樣才可以在qt 5.9.x 正確執行。

另外在archlinux的PKGBUILD中"patch -p1 -i ../qt-5.5.patch"非常奇怪的沒有執行,

所以我根據 阿吉的網頁的寫法修正成 sed -i 's/org.qt-project.Qt.QPlatformInputContextFactoryInterface/&.5.1/' qt5-im/gcin-qt5.h.in

這樣用qtplugininfo檢查libgcinplatforminputcontextplugin.so時就可以看到

IID "org.qt-project.Qt.QPlatformInputContextFactoryInterface.5.1" Qt 5.9.3 (debug)
User Data: {
    "Keys": [
        "gcin"
    ]
}

這時重新編譯gcin就可以在qt 5.9.x下正確執行。


guest
3subject: Promote 0 Bookmark 02017-11-30quote  

哇!這樣看來解決這問題已是開發者的層級了,小的只是基層的使用者,就靜待gcin改版了。

guest
4subject: Promote 0 Bookmark 02017-12-05quote  

guest

根據 阿吉部落格 的說法,需要將 qt5-im/gcin-qt5.h 中的 IID 版本,改成 org.qt-project.Qt.QPlatformInputContextFactoryInterface.5.1

這樣才可以在qt 5.9.x 正確執行。

另外在archlinux的PKGBUILD中"patch -p1 -i ../qt-5.5.patch"非常奇怪的沒有執行,

所以我根據 阿吉的網頁的寫法修正成 sed -i 's/org.qt-project.Qt.QPlatformInputContextFactoryInterface/&.5.1/' qt5-im/gcin-qt5.h.in

這樣用qtplugininfo檢查libgcinplatforminputcontextplugin.so時就可以看到

IID "org.qt-project.Qt.QPlatformInputContextFactoryInterface.5.1" Qt 5.9.3 (debug)
User Data: {
    "Keys": [
        "gcin"
    ]
}

這時重新編譯gcin就可以在qt 5.9.x下正確執行。


had patched like your way, but still didnt work with QT-5.9.3 under Archlinux, can you share PKGBUILD? thanks.

 

guest
5subject: Promote 0 Bookmark 02017-12-15quote  

guest

 

had patched like your way, but still didnt work with QT-5.9.3 under Archlinux, can you share PKGBUILD? thanks.

 

Archlinux had qt-5.10 update & gcin-2.8.5-2 rebuild with patch, but stall no go.

 

guest
6subject: Promote 0 Bookmark 02017-12-21quote  

以下是從 Archlinux的ABS上拿到的PKGBUILD,紅色部份是經過修改後的結果:

# $Id$
# Maintainer: Felix Yan <[email protected]>
# Contributor: Gaetan Bisson <[email protected]>
# Contributor: Andreas Radke <[email protected]>
# Contributor: damir <[email protected]>

pkgname=gcin
pkgver=2.8.5
pkgrel=1
pkgdesc='Input method server supporting various input methods'
url='http://hyperrate.com/dir.php?eid=67'
license=('LGPL')
arch=('i686' 'x86_64')
depends=('gtk2' 'libxtst')
makedepends=('qt5-base' 'qt4' 'gtk3' 'anthy' 'libchewing')
optdepends=('qt5-base: support for qt5 input method'
            'qt4: support for qt4 input method'
            'gtk3: support for gtk3 input method'
            'anthy: support for anthy input method'
            'libchewing: support for chewing input method')
source=("http://hyperrate.com/gcin-source/${pkgname}-${pkgver}.tar.xz"
        qt-5.5.patch)
sha1sums=('0bed162df43e3d5f65ff9f183b7957cdd9678731'
          'fd29b91d7b573546ecb3a8cb0341d4f11364cd1a')

install=install
prepare() {
    cd "${srcdir}/${pkgname}-${pkgver}"
    sed 's/lib64/lib/g' -i configure
    sed '/include suffixes-rule/a \
        CFLAGS+='"${CFLAGS}"' \
        LDFLAGS+='"${LDFLAGS}"' \
        OPTFLAGS=' \
        -i Makefile
    sed \
        -e 's:usr/include/qt5:usr/include/qt:g' \
        -e 's:QT=qt5:QT=qt:' \
        -e '/^MODVERSION=/a INCS+=-I/usr/include/qt/QtGui/$(MODVERSION) -I/usr/$
        -i qt5-im/Makefile
    sed \
        -e 's/org.qt-project.Qt.QPlatformInputContextFactoryInterface/&.5.1/' \
        -i qt5-im/gcin-qt5.h.in

    # FS#45732
    patch -p1 -i ../qt-5.5.patch

    # Qt 5.6 doesn't provide Qt5PlatformSupport.pc anymore
    sed -i 's/Qt5PlatformSupport//' qt5-im/Makefile
}

build() {    cd "${srcdir}/${pkgname}-${pkgver}"
    ./configure --prefix=/usr --use_i18n=Y
    make
}

package() {
    cd "${srcdir}/${pkgname}-${pkgver}"
    make DESTDIR="${pkgdir}" install
}
         

以上會經由makepkg -s後組成gcin-2.8.5-1-x86_64.pkg.tar.xz

sudo pacman -U gcin-2.8.5-1-x86_64.pkg.tar.xz安裝後

執行qtplugininfo /usr/lib/qt/plugins/platforminputcontexts/libgcinplatforminputcontextplugin.so

我在4.14.6-1-ARCH上面執行正常。

guest
7subject: Promote 0 Bookmark 02018-01-04quote  

我在 Arch Linux 上安裝 gcin 2.8.5-2,

在使用 Qt 5.10.0 的應用程式時也遇到這個問題了,

樓上附的這個 patch 幫助我順利解決了問題,

真的很感謝。

然後我花了點時間發了個 bug report:https://bugs.archlinux.org/task/56949

想說回覆在這邊更新一下狀況。

cges30901
joined: 2018-06-02
posted: 5
promoted:
bookmarked:
8subject: Promote 0 Bookmark 02018-06-02quote  

我發現從gcin 2.8.5開始,configure裡面有"cp gcin-qt5.h.in gcin-qt5.h"這一行,archlinuxqt-5.5.patch是修改gcin-qt5.h,但是執行configure之後gcin-qt5.h就會被gcin-qt5.h.in取代,所以當然沒有效果。

另外我發現如果Qt版本是5.5.1,就會變成執行"sed -e "s/FactoryInterface/FactoryInterface.5.1/" < gcin-qt5.h.in > gcin-qt5.h",也就是patch應該修改的內容,不知道為何只有Qt版本5.5.1才會這樣做。

EDIT: 下面附上了我做的patch,有需要的人可以下載。

edited: 1
eliu

joined: 2007-08-09
posted: 11478
promoted: 617
bookmarked: 187
新竹, 台灣
9subject: Promote 0 Bookmark 02018-06-02quote  

cges30901
不知道為何只有Qt版本5.5.1才會這樣做。

應該是 > 5.5 都會這樣。QT 改來改去,讓人頭痛。

if [ $QT5_IM = 'N' ]; then
mv gcin.spec gcin.spec.tmp
grep -v qt5/plugins/inputmethods gcin.spec.tmp > gcin.spec
else
cd qt5-im
qtver=`pkg-config --modversion Qt5Core`
minv=`echo $qtver | cut -d. -f2`
if [ $minv -ge 5 ]; then
echo "You have Qt > 5.5.1 "
sed -e "s/FactoryInterface/FactoryInterface.5.1/" < gcin-qt5.h.in > gcin-qt5.h
if [ $minv -ge 9 ]; then
cp -a Makefile59 Makefile
else
cp -a Makefile55 Makefile
fi
else
cp gcin-qt5.h.in gcin-qt5.h
fi
cd ..
for i in /usr/share/qt5/bin/moc /usr/lib/qt5/bin/moc /usr/lib/x86_64-linux-gnu/qt5/bin/moc /usr/lib/i386-linux-gnu/qt5/bin/moc /usr/lib64/qt5/bin/moc /usr/bin/moc
do
[ ! -x $i ] && continue
QT5_MOC=$i
echo "QT5_MOC=$QT5_MOC"
break
done
fi

cges30901
joined: 2018-06-02
posted: 5
promoted:
bookmarked:
10subject: Promote 0 Bookmark 02018-06-14quote  

原來 gcin 2.8.6 已經修好了。所以只要等 Arch Linux 更新大概就不會有問題了。

 

EDIT: 試著做 gcin 2.8.6 的 package 之後,我發現 libgcinplatforminputcontextplugin.so 會被安裝到 /usr/lib64/qt5/plugins/platforminputcontexts/ 而不是 /usr/lib64/qt/plugins/platforminputcontexts/,所以 Qt 5 的軟體還是無法輸入中文,但是如果我把 libgcinplatforminputcontextplugin.so 複製到 /usr/lib64/qt/plugins/platforminputcontexts/ 之後就可以正常輸入了。

edited: 2
guest
11subject: Promote 0 Bookmark 02018-06-24quote  

咦?我看了一下我的電腦(Ubuntu 16.04)上的版本還是2.8.5啊!更新、升級現有套件庫也是一樣。

eliu

joined: 2007-08-09
posted: 11478
promoted: 617
bookmarked: 187
新竹, 台灣
12subject: Promote 0 Bookmark 02018-06-24quote  

guest
咦?我看了一下我的電腦(Ubuntu 16.04)上的版本還是2.8.5啊!更新、升級現有套件庫也是一樣。

本站 build 是最新的版本,只是號碼沒有更新

cmchao
joined: 2018-07-27
posted: 3
promoted:
bookmarked:
Taiwan
13subject: Promote 0 Bookmark 02018-07-27quote  

可能是類似的問題,gcin 2.8.6 在 qbittorrent (3.3.1)  中無法輸入

 

OS: ubuntu 16.04.4

desktop: unity

gcin: 2.8.6

qbittorrent: 3.3.1

Qt5 : 5.5.1 

 

 

eliu

joined: 2007-08-09
posted: 11478
promoted: 617
bookmarked: 187
新竹, 台灣
14subject: Promote 0 Bookmark 02018-07-27quote  

有 install gcin-qt5-immodule 嗎?

本站的 gcin repository 不提供 32-bit 的 gcin-qt5-immodule

cmchao
joined: 2018-07-27
posted: 3
promoted:
bookmarked:
Taiwan
15subject: Promote 0 Bookmark 02018-07-27quote  

不能裝, dependency 不過,降版裝上去會鳥。

aptittue message 

cmchao@softpapa ~ (1)[0]$ sudo aptitude install gcin-qt5-immodule
The following NEW packages will be installed:
gcin-qt5-immodule{b}
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 67.9 kB of archives. After unpacking 152 kB will be used.
The following packages have unmet dependencies:
gcin-qt5-immodule : Depends: qtbase-abi-5-2-1 which is a virtual package and is not provided by any available package.

The following actions will resolve these dependencies:

Keep the following packages at their current version:
1) gcin-qt5-immodule [Not Installed]

 

Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

Install the following packages:
1) gcin-qt5-immodule [2.8.4+dfsg1-1ubuntu1.1 (xenial-updates)]
2) libgcin [2.8.4+dfsg1-1ubuntu1.1 (xenial-updates)]

 

Accept this solution? [Y/n/q/?] q
Abandoning all efforts to resolve these dependencies.

 

error message for 2nd resolving solution

Preparing to unpack .../libgcin_2.8.4+dfsg1-1ubuntu1.1_amd64.deb ...
Unpacking libgcin:amd64 (2.8.4+dfsg1-1ubuntu1.1) ...
dpkg: error processing archive /var/cache/apt/archives/libgcin_2.8.4+dfsg1-1ubuntu1.1_amd64.deb (--unpack):
trying to overwrite '/usr/lib/x86_64-linux-gnu/gcin/gcin1.so', which is also in package gcin 2.8.6+eliu-0
Selecting previously unselected package gcin-qt5-immodule:amd64.
Preparing to unpack .../gcin-qt5-immodule_2.8.4+dfsg1-1ubuntu1.1_amd64.deb ...
Unpacking gcin-qt5-immodule:amd64 (2.8.4+dfsg1-1ubuntu1.1) ...
Errors were encountered while processing:
/var/cache/apt/archives/libgcin_2.8.4+dfsg1-1ubuntu1.1_amd64.deb
Log ended: 2018-07-27 11:45:35


 

eliu

joined: 2007-08-09
posted: 11478
promoted: 617
bookmarked: 187
新竹, 台灣
16subject: Promote 0 Bookmark 02018-07-27quote  

參考這一篇

cht電腦資訊gcin
adm Find login register
views:42225