eska2000
eska2000

Reputation: 113

How to change Qt 5.9 virtual keyboard layout/locale

There is an amazing thing - Qt Virtual Keyboard. There is a very useful example in the examples of QtCreator.
Everything works, but there is one problem - the language is only English (or rather British English). And I need also Russian.

CONFIG += lang-ru
CONFIG += lang-ru_RU
CONFIG += lang-all

This all I tried. It does not help.

console.log ("locales available:" + VirtualKeyboardSettings.availableLocales)

It shows only en_GB.

I'm confused. The only discussion of the problem was found here.
And here: How to change Qt 5.7 virtual keyboard layout/locale
But the solution did not help.
I tried on Windows and on Mac - all the same.

How to add Russian localization? If it is possible give an example of the working code, please.

Upvotes: 2

Views: 2804

Answers (2)

Camilo
Camilo

Reputation: 83

If you add:

CONFIG += lang-ru_RU

to the virtualkeyboard.pro file and recompile the project it will generate the qtvirtualkeyboardplugin libraries with the russian layout. Put them in the platforminputcontexts folder and that's it.

Upvotes: 0

Bartosz Suchorowski
Bartosz Suchorowski

Reputation: 36

I know it has been months since you asked this question but I had similiar issues that I managed to solve. I thought that I will post the solution here, in case anybody needed it:

I assume you made the same mistake as me and set CONFIG+=lang- argument in your project (the project that uses virtual keyboard). You need to set it in qtvirtualkeyboard project instead and build it (create dll files).

qtVirtualKeyboard project settings

Then you can use the plugin in any project you wish.

Upvotes: 2

Related Questions