QtVirtualKeyboard not shown

Hi, is possible to have QtVirtualKeyboard in Qt application which uses EGLFS and OpenEmbedded Linux? I tried to add required packages and run the example Qt application, but the keyboard is not show. The Qt website says that the virtual keyboard is present for boot2qt but is it availaible for generic OpenEmbedded? In compiled linux image I can see that the libraries and plugins are included (hopefully all of them). Can anybody please help?

Best regards,
Tomas

Hi

Do these community post help you any?

https://www.toradex.com/community/questions/11569/module-qtquickvirtualkeyboard-is-not-installed.html
https://www.toradex.com/community/questions/9687/qt5-input-method-is-not-set.html

Max

Hi, well not really. But I tried at least to log the information about the keyboard and when I touch the screen I can see that the plugin is working but the keyboard is not visible (see log). Is it possible, that I don’t have correctly compiled SDK? Because I can’t find virtualkeyboard plugin in platforminputcontexts dir but it is present device after flashing to module.

qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImInputItemClipRectangle)
qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImInputItemClipRectangle)
qt.virtualkeyboard: PlatformInputContext::setFocusObject(): QQuickRootItem(0x2088ea0)
qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImQueryAll)
qt.virtualkeyboard: PlatformInputContext::commit()
qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImInputItemClipRectangle)
qt.virtualkeyboard: PlatformInputContext::showInputPanel()
qt.virtualkeyboard: PlatformInputContext::setFocusObject(): QQuickTextInput(0x20d0708)
qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImQueryAll)
qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImQueryInput)
qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImQueryInput)
qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImQueryInput)
qt.virtualkeyboard: PlatformInputContext::commit()
qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImInputItemClipRectangle)
qt.virtualkeyboard: PlatformInputContext::setFocusObject(): QQuickTextInput(0x20ce0c0)
qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImQueryAll)
qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImQueryInput)
qt.virtualkeyboard: PlatformInputContext::commit()
qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImInputItemClipRectangle)
qt.virtualkeyboard: PlatformInputContext::setFocusObject(): QQuickTextInput(0x20cbaf8)
qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImQueryAll)
qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImQueryInput)
qt.virtualkeyboard: PlatformInputContext::update(): QFlags<Qt::InputMethodQuery>(ImQueryInput)
qt.virtualkeyboard: PlatformInputContext::commit()

Thanks for advice

Yes, it’s possible. We have done exactly such a thing with Buildroot. But we have had to recompile the qt with qtvirtualkeyboard support.
And you should add

static {
    QT += svg
    QTPLUGIN += qtvirtualkeyboardplugin
}

to your .pro file. And

qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));

to your .cpp main file.

Thank you for reply. As I said I tried the Qt example application in which is the QT_IM_MODULE variable defined and qmake also have defined the static part so this should not be the problem. It may be a with the image itself but the qt plugin log shows that the virtual keyboard is somehow operational just the InputPanel is not displayed when requested or is displayed somewhere else. So what exactly do I need to have the feature? Just the qtvirtualkeyboard package or something else?
Best,
Tomas

How do you compile the SDK? As far as I can tell, the meta-qt5 layer in the morty release uses a separate package for the virtual keyboard, see here. Make sure that those are part of your SDK/image.

Well, I just followed the guide here and then this thread. But when I try to install the new SDK it hang on this message
Setting it up…ls: cannot access ‘/usr/local/oecore-x86_64_new/environment-setup-*’: No such file or directory
What is the correct way to add a package to SDK?

Hi,
you need to define InputPanel in you .qml file too.
Something like this:

InputPanel {
        id: inputPanel;
        y: parent.height; // position the top of the keyboard to the bottom of the screen/display

        anchors.left: parent.left;
        anchors.right: parent.right;
        Component.onCompleted: {
            inputPanel.keyboard.style.languagePopupListEnabled = false;
        }
        states: State {
            name: "visible";
            when: inputPanel.active;
            PropertyChanges {
                target: inputPanel;
                // position the top of the keyboard to the bottom of the text input field
                y: parent.height - inputPanel.height;
            }
        }

Hi, my InputPanel looks similar. I only have some transitions and data binding. My best guess right now is that it is an SDK problem

Hi

I guess you miss this commit in meta-qt5 which did not make it into meta-qt5/morty upstream.

Alternatively you could follow this workaround in your image recipe.

Max

Hi, the workaround actually worked. The keyboard is now visible and functional. Thank you for your help.
Tomas