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. How to implement virtual keyboard with PySide2 and QML
Forum Update on Monday, May 27th 2025

How to implement virtual keyboard with PySide2 and QML

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
qmlpyside2virtualkeyboardpython3qml binding
7 Posts 3 Posters 3.3k 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.
  • R Offline
    R Offline
    RG97
    wrote on 2 Nov 2019, 10:33 last edited by RG97 11 Mar 2019, 09:00
    #1

    I am developing an application where logic is written in python using PySide2 and UI part is written in QML. The application is bound to run on Raspberry Pi and has a requirement of the on-screen keyboard. However, I am not able to find any suitable approach to develop it for this setup.
    I have tried using the QML Virtual Keyboard class but for some reason, it always returns the following error whenever I try to run the example code on the device, even though all the python bindings and QML modules are installed.

    module "QtQuick.VirtualKeyboard" is not installed 
    

    Besides this, I didn't find any suitable approach to build this with PySide2 and QML. I have one idea in mind which involves developing the UI for keyboard in QML using GridLayout class and interfacing it with python using some sort of available mechanisms but I don't know if it's feasible or not.
    Can anyone guide me to a good approach ?

    Thanks
    Rahul

    J 1 Reply Last reply 4 Nov 2019, 06:28
    0
    • R RG97
      2 Nov 2019, 10:33

      I am developing an application where logic is written in python using PySide2 and UI part is written in QML. The application is bound to run on Raspberry Pi and has a requirement of the on-screen keyboard. However, I am not able to find any suitable approach to develop it for this setup.
      I have tried using the QML Virtual Keyboard class but for some reason, it always returns the following error whenever I try to run the example code on the device, even though all the python bindings and QML modules are installed.

      module "QtQuick.VirtualKeyboard" is not installed 
      

      Besides this, I didn't find any suitable approach to build this with PySide2 and QML. I have one idea in mind which involves developing the UI for keyboard in QML using GridLayout class and interfacing it with python using some sort of available mechanisms but I don't know if it's feasible or not.
      Can anyone guide me to a good approach ?

      Thanks
      Rahul

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 4 Nov 2019, 06:28 last edited by
      #2

      @RG97 Did you install "Qt Virtual Keyboard"?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • R Offline
        R Offline
        RG97
        wrote on 4 Nov 2019, 07:15 last edited by
        #3

        Hi
        Yes I have installed qml-module-qtquick-virtualkeyboard module,still it gives me the error whenever I try to import the module in QML file.

        J 1 Reply Last reply 4 Nov 2019, 07:17
        0
        • R RG97
          4 Nov 2019, 07:15

          Hi
          Yes I have installed qml-module-qtquick-virtualkeyboard module,still it gives me the error whenever I try to import the module in QML file.

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 4 Nov 2019, 07:17 last edited by
          #4

          @RG97 You need the keyboard installed on your Raspberry Pi.
          And I think you need to import with a version number like shown here https://doc.qt.io/qt-5/qtvirtualkeyboard-basic-example.html

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • R Offline
            R Offline
            RG97
            wrote on 4 Nov 2019, 07:32 last edited by
            #5

            @jsulm I installed the on-screen keyboard and trued importing the version as given in example along with several other ones, but still no luck.

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mell
              wrote on 8 Nov 2019, 12:00 last edited by
              #6

              Hello! I have the absolutly same problem. Do you mean that you have installed qml-module-qtquick-virtualkeyboard via qt maintenance tool or it's additional library to pySide?

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mell
                wrote on 14 Nov 2019, 12:39 last edited by
                #7

                try to add this to main.py

                import os
                os.environ["QT_IM_MODULE"] = "qtvirtualkeyboard"
                
                1 Reply Last reply
                1

                5/7

                4 Nov 2019, 07:32

                • Login

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