2012-09-28 165 views
1

我爲我的Ubuntu桌面構建了Maliit(https://wiki.maliit.org/Main_Page)虛擬屏幕鍵盤,它適用於附帶的示例應用程序。我還能夠製作自己的簡單Qt示例應用程序,該應用程序可以在小部件呈現焦點時顯示鍵盤。Qt虛擬鍵盤和QInputContextFactory

我正在嘗試將虛擬鍵盤部署到在觸摸屏上運行在我的目標板上的嵌入式Linux系統。目標板上沒有安裝X11,我使用QWS(-qws)運行了不少Qt應用程序。

Maliit體系結構(http://maliit.org/doc/framework/latest/architecture.html)需要服務器實例與應用程序進行通信,應用程序使用QApplication :: setInputContext將其設置爲輸入上下文。

在Ubuntu上我簡單地做:

export QT_IM_MODULE=Maliit 
maliit-server -software & 
maliit-exampleapp-plainqt 

而且鍵盤出現,一切正常(當然我有X11)!

在嵌入式主板我在一個SSH會話做:

export QT_IM_MODULE=Maliit 
dbus-launch --auto-syntax maliit-server -software -qws 

然後又是SSH會話:

export QT_IM_MODULE=Maliit 
source /find_dbus_address.sh 
echo $DBUS_SESSION_BUS_ADDRESS 
maliit-exampleapp-plainqt -qws 

但我總是得到錯誤:

QApplication::setInputContext: called with 0 input context 

哪意味着示例應用程序在下列行中主要失敗:

// Workaround for lighthouse Qt 
kit.setInputContext(QInputContextFactory::create("Maliit", &kit)); 

的嵌入式主板的「PS」命令的輸出顯示以下內容:

191 user  1692 S -sh 
    192 user 39608 S maliit-server -software -qws 
    196 user  2092 S /usr/bin/dbus-daemon --fork --print-pid 4 --print-address 6 --session 
    201 user  1692 R ps 

所以服務器沒有積極跑動像它在Ubuntu ......但在一個「可中斷睡眠'狀態。鼠標確實在這種狀態下移動。我仍然得到0輸入上下文錯誤。

這裏有一個錯誤 - 聲稱QWS與Maliit正在爲他工作,他至少可以看到輸入>https://bugs.maliit.org/show_bug.cgi?id=185 ..

還有Maliit的模式,理應繞開DBUS(見這裏 - - >http://www.jonnor.com/2012/03/),並與我仍然得到 '0輸入上下文' 錯誤:

於是,我就做我的嵌入式主板:

export QT_IM_MODULE=MaliitDirect ; echo $QT_IM_MODULE ; maliit-exampleapp-embedded -qws 

並始終接受:

QApplication::setInputContext: called with 0 input context 
Unable to embedded Maliit input method widget 

我構建的Qt 4.8.2嵌入在Ubuntu 12.04桌面上,可以使用-qws和示例應用程序啓動maliit服務器,並且可以使用QWS查看虛擬鍵盤的工作情況。我使用git repo的最新克隆插件和maliit框架。

我的問題是運行相同的maliit服務器和示例應用程序編譯爲我的ARM板在目標上。我經常得到錯誤QApplication :: setInputContext:用0輸入上下文調用。

我用DBUS dbus-monitor工具做了一些監測。我最初打開1個SSH會話到我的主板,然後運行eval dbus-launch --auto-syntax並複製DBUS_SESSION_BUS。然後我打開了2個新的SSH會話。

在第一個我做:

$ export DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-vVNCW9zP7e,guid=75ecd72645dfb9b4358048db506dfec 
$ export QT_IM_MODULE=Maliit 
$ maliit-server -software -qws 

在第二個我做:

$ export DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-vVNCW9zP7e,guid=75ecd72645dfb9b4358048db506dfecb 
$ export QT_IM_MODULE=Maliit 
$ maliit-exampleapp-settings -qws 

不過,我馬上面臨着:

[9;0]QApplication::setInputContext: called with 0 input context 
SettingsWidget::connected() 
SettingsWidget::pluginSettingsReceived() 
Setting layout QVariant(QString, "nemo-keyboard.qml:") 

而在dbus-monitor外殼我看到:

desktop.DBus; member=NameOwnerChanged 
    string ":1.6" 
    string "" 
    string ":1.6" 
method call sender=:1.6 -> dest=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello 
signal sender=org.freedesktop.DBus -> dest=(null destination) serial=8 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged 
    string "org.maliit.server" 
    string "" 
    string ":1.6" 
method call sender=:1.6 -> dest=org.freedesktop.DBus serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RequestName 
    string "org.maliit.server" 
    uint32 4 
signal sender=org.freedesktop.DBus -> dest=(null destination) serial=9 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged 
    string ":1.7" 
    string "" 
    string ":1.7" 
method call sender=:1.7 -> dest=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello 
method call sender=:1.7 -> dest=org.maliit.server serial=2 path=/org/maliit/server/address; interface=org.freedesktop.DBus.Properties; member=Get 
    string "org.maliit.Server.Address" 
    string "address" 
method return sender=:1.6 -> dest=:1.7 reply_serial=2 
    variant  string "unix:abstract=/tmp/maliit-server/dbus-CPgFHrxwAi,guid=dfc1dfc367a647e36e6e4c3c506e00db" 

有沒有人有關於這裏發生了什麼的想法? DBUS可能與QInputContextFactory失敗有關嗎?我能以某種方式獲得更多有關失敗的信息以及爲什麼我無法設置輸入上下文的信息嗎?

謝謝你的幫助 -

回答

3

難以置信,這樣一個簡單的修補程序。只需設置像這樣的QT_PLUGIN_PATH:

export QT_PLUGIN_PATH=/home/user/plugins 
+0

你有過這樣的問題http://stackoverflow.com/questions/33283961/maliit-keyboard-black-box-on-letters來的?對不起,我知道你發佈這個問題已經很長時間了。 – ramtheconqueror