Important: Please read the Qt Code of Conduct -

Switch input context while running app

  • I wrote custom plugin derived from QPlatformInputContext to use it as virtual input panel. So to load plugin i use :

    qputenv("QT_IM_MODULE", QByteArray("customvirtualkeyboard"));
    QApplication a(argc, argv);

    It's all works fine. But qputenv works only before QApplication was created. But i want to have oportunity to on and off virtual panel while running application.
    Is there a way to somehow update enviroment to qputenv/qunsetenv works? Or maybe switch inputcontext to default?

  • Lifetime Qt Champion


    AFAIK, you can't do it dynamically like that. Most of the QPA plugins creates it once the first time the input context is requested or even at the backend creation time.

    So basically it means that you would need to add support for that in the backend of the platform your application will run on.

Log in to reply