Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Minimal working example for qtvirtualkeyboard - keyboard not showing up

Minimal working example for qtvirtualkeyboard - keyboard not showing up

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 198 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DrEmbo
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved