How to enable the language switcher in the Qt Quick Virtual Keyboard - Basic Example
-
Hi. I am new to Qt Creator on Linux. From the Welcome screen I opened "Qt Quick Virtual Keyboard - Basic Example". It runs great, but I want to enable the language switcher to the left of the space bar.
From the documentation and threads on this forum, I understand that I should add
CONFIG += lang-all, but I cannot figure out where, or how to make it take effect.My project has a file
basic.pro, but addingCONFIG += lang-allthere has no effect. I think I need to modify the qtvirtualkeyboard itself, and not just the example. There is novirtualkeyboard.proin my project. There are 7 different ones spread around the Qt installation:- ./Examples/Qt-5.10.0/virtualkeyboard/virtualkeyboard.pro
- ./Examples/QtVirtualKeyboard/virtualkeyboard/virtualkeyboard.pro
- ./5.10.0/Src/qtvirtualkeyboard/examples/virtualkeyboard/virtualkeyboard.pro
- ./5.10.0/Src/qtvirtualkeyboard/src/virtualkeyboard/virtualkeyboard.pro
- ./EnterpriseAddOns/QtVirtualKeyboard/2.0/Src/virtualkeyboard.pro
- ./EnterpriseAddOns/QtVirtualKeyboard/2.0/Src/examples/virtualkeyboard/virtualkeyboard.pro
- ./EnterpriseAddOns/QtVirtualKeyboard/2.0/Src/src/virtualkeyboard/virtualkeyboard.pro
Should I modify one of those, and how do I rebuild virtualkeyboard so it uses the new config?
I can build and run the example from the command line:
cd Examples/Qt-5.10.0/virtualkeyboard/basic /sw/bin/qt/5.10.0/gcc_64/bin/qmake "CONFIG+=lang-all" make "CONFIG+=lang-all" ./basic...but the language switcher is still disabled. I think it's because again, I need to rebuild the virtualkeyboard plugin and not just the example.
-
Update: I got a lot further.
cd qt/5.10.0/Src/qtvirtualkeyboard/src/virtualkeyboard /sw/bin/qt/5.10.0/gcc_64/bin/qmake CONFIG+="lang-all" && make && make installIt will give errors like
Library 'pinyin' is not defined.cd qt/5.10.0/Src/qtvirtualkeyboard/src/virtualkeyboard/3rdparty/openwnn /sw/bin/qt/5.10.0/gcc_64/bin/qmake && makeSame for pinyin, tcime, then go back and build virtualkeyboard.
The example
basicdoesn't need to be rebuilt, just run it. I guess qtvirtualkeyboard is dynamically linked. Unclear how it knows where it load it from.Now language switcher is enabled, and I can scroll through a long list of languages! I wish I knew how to do all this inside QtCreator though.
Languages like Japanese that need an IME are still broken. When I pick it, there is an error:
qml: Qt.createQmlObject(): failed to create object: qrc:/QtQuick/VirtualKeyboard/content/layouts/ja_JP/japaneseInputMethod:1:57: JapaneseInputMethod is not a typeSomehow
openwnnis still not loaded correctly. Any ideas? -
@TorKlingberg DId you get it to work?