Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to use virtual keyboard on Raspberry Pi 4
Forum Updated to NodeBB v4.3 + New Features

How to use virtual keyboard on Raspberry Pi 4

Scheduled Pinned Locked Moved Unsolved General and Desktop
25 Posts 4 Posters 5.1k Views 3 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.
  • I IknowQT
    18 Feb 2022, 07:14

    @JKSH

    #include <QQuickView>
    #include <QGuiApplication>
    #include <QQmlEngine>
    #include <QtWidgets/QApplication>
    
    int main(int argc, char *argv[])
    {
        qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
    
        QGuiApplication app(argc, argv);
        QApplication n = qobject_cast<QApplication>(app);
    
    
        QQuickView view(QString("qrc:/%2").arg(MAIN_QML));
        if (view.status() == QQuickView::Error)
            return -1;
        view.setResizeMode(QQuickView::SizeRootObjectToView);
        view.show();
    
        return app.exec();
    }
    

    Are you talking about converting QGuiApplication to QApplication?
    An error occurs. >:

    J Offline
    J Offline
    jsulm
    Lifetime Qt Champion
    wrote on 18 Feb 2022, 07:56 last edited by
    #16

    @IknowQT said in How to use virtual keyboard on Raspberry Pi 4:

    QGuiApplication app(argc, argv);
    QApplication n = qobject_cast<QApplication>(app);

    What is this actually?!

    Why not simply

    QApplication app(argc, argv);
    

    ?

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

    I 1 Reply Last reply 18 Feb 2022, 08:08
    0
    • J jsulm
      18 Feb 2022, 07:56

      @IknowQT said in How to use virtual keyboard on Raspberry Pi 4:

      QGuiApplication app(argc, argv);
      QApplication n = qobject_cast<QApplication>(app);

      What is this actually?!

      Why not simply

      QApplication app(argc, argv);
      

      ?

      I Offline
      I Offline
      IknowQT
      wrote on 18 Feb 2022, 08:08 last edited by
      #17

      @jsulm
      I didn't quite understand what you mean to convert QguiApplication.

      @JKSH
      The keyboard works normally when you follow the steps you mentioned.

      int main(int argc, char *argv[])
      {
          qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
      
          QApplication app(argc, argv);
          //QApplication app2 = static_cast<QApplication>(app);
      
      
          QQuickView view(QString("qrc:/%2").arg(MAIN_QML));
          if (view.status() == QQuickView::Error)
              return -1;
          view.setResizeMode(QQuickView::SizeRootObjectToView);
          view.show();
      
          return app.exec();
      }
      
      J 1 Reply Last reply 18 Feb 2022, 08:17
      0
      • I IknowQT
        18 Feb 2022, 08:08

        @jsulm
        I didn't quite understand what you mean to convert QguiApplication.

        @JKSH
        The keyboard works normally when you follow the steps you mentioned.

        int main(int argc, char *argv[])
        {
            qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
        
            QApplication app(argc, argv);
            //QApplication app2 = static_cast<QApplication>(app);
        
        
            QQuickView view(QString("qrc:/%2").arg(MAIN_QML));
            if (view.status() == QQuickView::Error)
                return -1;
            view.setResizeMode(QQuickView::SizeRootObjectToView);
            view.show();
        
            return app.exec();
        }
        
        J Offline
        J Offline
        JKSH
        Moderators
        wrote on 18 Feb 2022, 08:17 last edited by
        #18

        @IknowQT said in How to use virtual keyboard on Raspberry Pi 4:

        The keyboard works normally when you follow the steps you mentioned.

        I also said:

        ...create + show a QTextEdit. What happens when you click on the QTextEdit? What happens when you click on one of the fields in the QQuickView?

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        I 1 Reply Last reply 18 Feb 2022, 08:46
        0
        • J JKSH
          18 Feb 2022, 08:17

          @IknowQT said in How to use virtual keyboard on Raspberry Pi 4:

          The keyboard works normally when you follow the steps you mentioned.

          I also said:

          ...create + show a QTextEdit. What happens when you click on the QTextEdit? What happens when you click on one of the fields in the QQuickView?

          I Offline
          I Offline
          IknowQT
          wrote on 18 Feb 2022, 08:46 last edited by
          #19

          @JKSH

          I tried what you did, the result is that once you click on lineedit made into widget the keyboard appears

          However, the keyboard appears within the quick screen UI area.
          It seems certain that the keyboard reacts when lineEdit is clicked.

          J 1 Reply Last reply 18 Feb 2022, 13:20
          0
          • I IknowQT
            18 Feb 2022, 08:46

            @JKSH

            I tried what you did, the result is that once you click on lineedit made into widget the keyboard appears

            However, the keyboard appears within the quick screen UI area.
            It seems certain that the keyboard reacts when lineEdit is clicked.

            J Offline
            J Offline
            JKSH
            Moderators
            wrote on 18 Feb 2022, 13:20 last edited by
            #20

            @IknowQT said in How to use virtual keyboard on Raspberry Pi 4:

            I tried what you did, the result is that once you click on lineedit made into widget the keyboard appears

            ...

            It seems certain that the keyboard reacts when lineEdit is clicked.

            Great! You now have Qt Virtual Keyboard working with a QWidget.

            However, the keyboard appears within the quick screen UI area.

            I'm not sure what you mean -- the keyboard is always meant to appear in the bottom half of the screen.

            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

            I 2 Replies Last reply 20 Feb 2022, 23:14
            0
            • J JKSH
              18 Feb 2022, 13:20

              @IknowQT said in How to use virtual keyboard on Raspberry Pi 4:

              I tried what you did, the result is that once you click on lineedit made into widget the keyboard appears

              ...

              It seems certain that the keyboard reacts when lineEdit is clicked.

              Great! You now have Qt Virtual Keyboard working with a QWidget.

              However, the keyboard appears within the quick screen UI area.

              I'm not sure what you mean -- the keyboard is always meant to appear in the bottom half of the screen.

              I Offline
              I Offline
              IknowQT
              wrote on 20 Feb 2022, 23:14 last edited by IknowQT
              #21

              @JKSH

              e557f7fe-ff5b-4c45-b913-a9f5c05f9af1-image.png

              I popped up a UI called form and clicked lineEdit. The virtual keyboard appears, but it does not appear in the form widget, but in the quick view.

              int main(int argc, char *argv[])
              {
                  qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
              
                  QApplication app(argc, argv);
                  //QApplication app2 = static_cast<QApplication>(app);
              
                  Form* f = new Form();
                  f->show();
              
                  QQuickView view(QString("qrc:/%2").arg(MAIN_QML));
                  if (view.status() == QQuickView::Error)
                      return -1;
                  view.setResizeMode(QQuickView::SizeRootObjectToView);
                  view.show();
                  return app.exec();
              }
              
              I 1 Reply Last reply 23 Feb 2022, 06:40
              0
              • I IknowQT
                20 Feb 2022, 23:14

                @JKSH

                e557f7fe-ff5b-4c45-b913-a9f5c05f9af1-image.png

                I popped up a UI called form and clicked lineEdit. The virtual keyboard appears, but it does not appear in the form widget, but in the quick view.

                int main(int argc, char *argv[])
                {
                    qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard"));
                
                    QApplication app(argc, argv);
                    //QApplication app2 = static_cast<QApplication>(app);
                
                    Form* f = new Form();
                    f->show();
                
                    QQuickView view(QString("qrc:/%2").arg(MAIN_QML));
                    if (view.status() == QQuickView::Error)
                        return -1;
                    view.setResizeMode(QQuickView::SizeRootObjectToView);
                    view.show();
                    return app.exec();
                }
                
                I Offline
                I Offline
                IknowQT
                wrote on 23 Feb 2022, 06:40 last edited by
                #22

                @JKSH

                Please reply if there is another way.

                1 Reply Last reply
                0
                • J JKSH
                  18 Feb 2022, 13:20

                  @IknowQT said in How to use virtual keyboard on Raspberry Pi 4:

                  I tried what you did, the result is that once you click on lineedit made into widget the keyboard appears

                  ...

                  It seems certain that the keyboard reacts when lineEdit is clicked.

                  Great! You now have Qt Virtual Keyboard working with a QWidget.

                  However, the keyboard appears within the quick screen UI area.

                  I'm not sure what you mean -- the keyboard is always meant to appear in the bottom half of the screen.

                  I Offline
                  I Offline
                  IknowQT
                  wrote on 8 Mar 2022, 00:51 last edited by
                  #23

                  @JKSH
                  If you don't know, answer that you don't know
                  I think it's a courtesy to anyone waiting for an answer.

                  J 1 Reply Last reply 8 Mar 2022, 06:41
                  0
                  • I IknowQT
                    8 Mar 2022, 00:51

                    @JKSH
                    If you don't know, answer that you don't know
                    I think it's a courtesy to anyone waiting for an answer.

                    J Offline
                    J Offline
                    JKSH
                    Moderators
                    wrote on 8 Mar 2022, 06:41 last edited by
                    #24

                    @IknowQT said in How to use virtual keyboard on Raspberry Pi 4:

                    @JKSH
                    If you don't know, answer that you don't know
                    I think it's a courtesy to anyone waiting for an answer.

                    I'm sorry for keeping you waiting without a response.

                    I don't know why your virtual keyboard appears inside the Qt Quick window; I was planning to investigate but my RPi was deployed to another task.

                    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                    1 Reply Last reply
                    0
                    • I Offline
                      I Offline
                      IknowQT
                      wrote on 20 Apr 2022, 02:18 last edited by
                      #25

                      Can anyone suggest a solution to this problem?
                      No one is interested. Is there no way or is it just being on the lookout?

                      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