Minimal working example for qtvirtualkeyboard - keyboard not showing up
Unsolved
Mobile and Embedded
-
Hello there,
I am trying to get a small test program for qt virtual keyboard running. I have created a QtQuick application and added the following code to the main.qml
import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.VirtualKeyboard 2.15 Window { id: window width: 640 height: 480 visible: true title: qsTr("Hello World") TextInput { text: "Text" cursorVisible: false activeFocusOnPress:true } }
main.cpp looks like this:
#include <QGuiApplication> #include <QQmlApplicationEngine> int main(int argc, char *argv[]) { qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard")); #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #endif QGuiApplication app(argc, argv); QQmlApplicationEngine engine; const QUrl url(QStringLiteral("qrc:/main.qml")); QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, &app, [url](QObject *obj, const QUrl &objUrl) { if (!obj && url == objUrl) QCoreApplication::exit(-1); }, Qt::QueuedConnection); engine.load(url); return app.exec(); }
When I run it on my Ubuntu the virtual keyboard shows up and I can use it accordingly.
However, if I cross-compile it for the embedded platform and start it I can see the text, but when I
click on it I can see the cursor but the keyboard is not showing.I am using the eglfs platform.
The strace command shows that the virtual keyboard plugin is being loaded.Maybe I am missing something very important, therefore I would appreciate your help.
Best regards,
Drembo