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. virtualkeyboard can not be triggered by using touch screen
Qt 6.11 is out! See what's new in the release blog

virtualkeyboard can not be triggered by using touch screen

Scheduled Pinned Locked Moved Solved Mobile and Embedded
17 Posts 4 Posters 3.2k Views 1 Watching
  • 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.
  • MozzieM Offline
    MozzieM Offline
    Mozzie
    wrote on last edited by
    #1

    hi,

    recently, I am using qtvirtualkeyboard as input method, but when I want use touch screen to edit QTextEdit content, the virtualkeyboard would not be triggered by touch the screen, but if i use mouse click the QTextEdit, the virtualkeyboard will come out

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Which version of Qt ?
      On which device ?
      Does the touchscreen work otherwise ?
      Do you have the same issue for a QLineEdit ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      MozzieM 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Which version of Qt ?
        On which device ?
        Does the touchscreen work otherwise ?
        Do you have the same issue for a QLineEdit ?

        MozzieM Offline
        MozzieM Offline
        Mozzie
        wrote on last edited by
        #3

        @SGaist
        thank you
        my Qt version is Qt5.12.10
        I am using nvidia jetson tx2
        the touch is working, and I tried QLineEdit and QSpinBox, all the same.

        and I am not using gnome desktop, I am using xsession to run my qt application when the system start

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          When you say all the same, do you mean none of them triggers the virtual keyboard ?

          Is your touchscreen seen as a mouse ?
          Can you interact with a button through it ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          MozzieM 2 Replies Last reply
          0
          • SGaistS SGaist

            When you say all the same, do you mean none of them triggers the virtual keyboard ?

            Is your touchscreen seen as a mouse ?
            Can you interact with a button through it ?

            MozzieM Offline
            MozzieM Offline
            Mozzie
            wrote on last edited by
            #5

            @SGaist thanks.
            Yes, none of the editable widget triggers the virtual keyboard by touch screen, but can triggers the virtual keyboard by click mouse left button.
            I use following code to check my touch screen

            void TextEdit::mousePressEvent(QMouseEvent *event)
            {
            	qDebug() << __FUNCTION__ << event->button();
            	QTextEdit::mousePressEvent(event);
            }
            

            and it print " TextEdit::mousePressEvent Qt::LeftButton ", same as click mouse left button,
            and I can use my touch screen to click button, it work with buttons

            1 Reply Last reply
            0
            • SGaistS SGaist

              When you say all the same, do you mean none of them triggers the virtual keyboard ?

              Is your touchscreen seen as a mouse ?
              Can you interact with a button through it ?

              MozzieM Offline
              MozzieM Offline
              Mozzie
              wrote on last edited by Mozzie
              #6

              @SGaist
              hi
              I found is I call activateWindow() before showing my window, the virtualkeyboard can come out, but it will focus my first editable widget and show the virtualkeyboard automatically.

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Some more questions:

                • are you using Qt's virtual keyboard ?
                • does your touch screen act normally with your other applications ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                MozzieM 1 Reply Last reply
                0
                • SGaistS SGaist

                  Some more questions:

                  • are you using Qt's virtual keyboard ?
                  • does your touch screen act normally with your other applications ?
                  MozzieM Offline
                  MozzieM Offline
                  Mozzie
                  wrote on last edited by
                  #8

                  @SGaist said in virtualkeyboard can not be triggered by using touch screen:

                  are you using Qt's virtual keyboard ?

                  hi

                  1. I have use following command before running my application.
                  export QT_IM_MODULE=qtvirtualkeyboard
                  

                  and I can see qtvirtualkeyboard by clicking editable widget by mouse

                  1. I tested my touch screen on gnome desktop with qt application, it worked, but if i run the qt application by x11 session directly , the qt application can detect left button clicked but can not focus the editable widget , and can not trigger the qt virtualkeyboard. but if I using mouse to trigger it once or call activateWindow() before showing the window, the virtualkey board can be triggered by my touch screen after that, but if i call activateWindow() the window will focus on my editable widget automaticly and the qt virtualkeyboard will also come out , I want to use the virtualkey board when I touch the editable widget.

                  thanks for your help

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    What do you mean by X11 session directly ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    MozzieM 1 Reply Last reply
                    0
                    • SGaistS SGaist

                      What do you mean by X11 session directly ?

                      MozzieM Offline
                      MozzieM Offline
                      Mozzie
                      wrote on last edited by
                      #10

                      @SGaist
                      I want to boot to qt application like embedded system, rather than boot to gnome desktop then run qt application.
                      so I changed the xsession configuration replace gnome desktop to run my qt application.
                      It is kind of like boot2qt (https://doc.qt.io/archives/qt-5.13-devicecreation/index.html)

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        So one single application ?
                        Then you will likely have to do some configuration yourself with regards to input handling.

                        See the Qt for embedded Linux chapter in Qt's documentation.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        MozzieM 1 Reply Last reply
                        0
                        • JoeCFDJ Offline
                          JoeCFDJ Offline
                          JoeCFD
                          wrote on last edited by JoeCFD
                          #12
                          installEventFilter( this ); to check if touch event is triggered at first?
                          
                          MozzieM 1 Reply Last reply
                          0
                          • JoeCFDJ JoeCFD
                            installEventFilter( this ); to check if touch event is triggered at first?
                            
                            MozzieM Offline
                            MozzieM Offline
                            Mozzie
                            wrote on last edited by
                            #13

                            @JoeCFD
                            hi,
                            I tried to use installEventFilter( this ); to check if touch event is triggered, and I got QMouseEvent which button() is Qt::LeftButton

                            1 Reply Last reply
                            0
                            • SGaistS SGaist

                              So one single application ?
                              Then you will likely have to do some configuration yourself with regards to input handling.

                              See the Qt for embedded Linux chapter in Qt's documentation.

                              MozzieM Offline
                              MozzieM Offline
                              Mozzie
                              wrote on last edited by Mozzie
                              #14

                              @SGaist

                              Yes, one single application, and thanks for your advice.
                              I am not sure I am using the right way to just run an application without desktop enviroment.
                              Do i need to change platform like eglfs or wayland? I am now using xcb, my system is ubuntu18.04 and my device is jetson tx2

                              1 Reply Last reply
                              0
                              • SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on last edited by
                                #15

                                If you do not want any desktop environment, eglfs would make more sense.

                                Interested in AI ? www.idiap.ch
                                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                MozzieM 1 Reply Last reply
                                0
                                • SGaistS SGaist

                                  If you do not want any desktop environment, eglfs would make more sense.

                                  MozzieM Offline
                                  MozzieM Offline
                                  Mozzie
                                  wrote on last edited by
                                  #16

                                  @SGaist
                                  ok, thank you very much

                                  1 Reply Last reply
                                  0
                                  • X Offline
                                    X Offline
                                    xuiiao
                                    wrote on last edited by
                                    #17

                                    If you use virtualkeyboard by embedding qml file to the QQuickWidget, In touch screen situation, you need to set this: ui->quickWidget->setAttribute(Qt::WA_AcceptTouchEvents)

                                    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