Results 1 to 3 of 3

Thread: Run QtVirtualKeyboard using QQuickWidget

  1. #1
    Join Date
    Jun 2017
    Posts
    3
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Question Run QtVirtualKeyboard using QQuickWidget

    Hi all,

    I am trying to make the QtVirtualKeyboard example work with QQuickWidget instead of QQuickView. For QuickView, I use the following main.cpp code, which works fine for me:

    Qt Code:
    1. #include <QQuickView>
    2. #include <QGuiApplication>
    3. #include <QQmlEngine>
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
    8.  
    9. QGuiApplication app(argc, argv);
    10.  
    11. QQuickView view(QString("qrc:/%2").arg(MAIN_QML));
    12. view.setResizeMode(QQuickView::SizeRootObjectToView);
    13. view.show();
    14.  
    15. return app.exec();
    16. }
    To copy to clipboard, switch view to plain text mode 

    I run into problems, when changing to QQuickWidgets with the following implementation of main.cpp:

    Qt Code:
    1. #include <QQuickWidget>
    2. #include <QApplication>
    3. #include <QQmlEngine>
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
    8.  
    9. QApplication app(argc, argv);
    10.  
    11. QQuickWidget w(QString("qrc:/%2").arg(MAIN_QML));
    12. w.setResizeMode(QQuickWidget::SizeRootObjectToView);
    13. w.show();
    14.  
    15. return app.exec();
    16. }
    To copy to clipboard, switch view to plain text mode 

    When I hit the input fields, the virtual keyboard shows up, but when I start typing at the keyboard, I get the message "input method is not set", which seems to be related to the input method plugin. No chars appear in the input fields.
    Any ideas? The QML-code didn't change between the above variants of main.cpp

    BTW: I am using Linux, gcc, Qt 5.9.0, EGLFS plugin

    Thanks for any suggestions!

    Regards,
    Patrick

  2. #2
    Join Date
    Jun 2017
    Posts
    3
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Run QtVirtualKeyboard using QQuickWidget

    I did some further tests and the same code works with Qt 5.8.0, but fails on 5.9.0

  3. #3
    Join Date
    Nov 2010
    Posts
    44
    Thanks
    7
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Run QtVirtualKeyboard using QQuickWidget


Similar Threads

  1. QTVirtualKeyboard InputMethod issue
    By khalid80 in forum Qt Quick
    Replies: 3
    Last Post: 14th May 2020, 10:01

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.