Does PyQt5/pyqt4 already supports QtVirtualKeyboard with Handwriting Recognition?

前端 未结 2 1928
盖世英雄少女心
盖世英雄少女心 2021-01-24 19:56

I\'m working on a desktop application using pyqt5, and I want to use a Virtual Keyboard with Handwriting Recognition. I saw that Qt, QtVirtualKeyboard already support it.

<
2条回答
  •  无人及你
    2021-01-24 20:27

    I been stuck with this too, and i am new to Qt After some researching, and digging in source code, found the solution

    You dont need to import it to use it since its a module it will implement itself to every qt input

    Well you dont need to install it on PyQt5 but on Qt5 if it is not already come with your Qt package, if you use archlinux you can install it with pacman

    pacman -S qt5-virtualkeyboard
    

    If you cannot find it in you os repositories try to build it here is documantation https://doc.qt.io/qt-5/qtvirtualkeyboard-index.html

    Then to use it in your pyqt application, set environmental variable QT_IM_MODULE to "qtvirtualkeyboard" either from your bash or inside the top your script like

    import os
    os.environ["QT_IM_MODULE"] = "qtvirtualkeyboard"
    

提交回复
热议问题