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. Show keyboard when QTextEdit is activated

Show keyboard when QTextEdit is activated

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 4 Posters 5.2k 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.
  • ivanicyI Offline
    ivanicyI Offline
    ivanicy
    wrote on last edited by
    #1

    Hello!

    I am developing a tablet application with Windows 10. I have some data inputs and I want to show the keyboard when I push on them. I don't know why, but in some cases, the keyboard appears automatically and in other cases it doesn't appear.

    Do you know how to fix it?

    Thank you very much!!

    1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      Are you using QtWidgets or QtQuick (QML)?

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      ivanicyI 1 Reply Last reply
      1
      • VRoninV VRonin

        Are you using QtWidgets or QtQuick (QML)?

        ivanicyI Offline
        ivanicyI Offline
        ivanicy
        wrote on last edited by
        #3

        @VRonin I am using QtWidgets

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mostefa
          wrote on last edited by
          #4

          Hi @ivanicy

          Which Qt version are you using?

          Are you using the Qt Virtual Keyboard?
          How are you displaying your keyboard , can you share a sample code?

          ivanicyI 1 Reply Last reply
          1
          • M mostefa

            Hi @ivanicy

            Which Qt version are you using?

            Are you using the Qt Virtual Keyboard?
            How are you displaying your keyboard , can you share a sample code?

            ivanicyI Offline
            ivanicyI Offline
            ivanicy
            wrote on last edited by
            #5

            @mostefa No, I want to show the system keyboard ( I am running the program in a tablet). I have observed that if the echoMode property of the QLineEdit is "password" when I push on it, the windows keyboard appears automatically, but, if the echoMode property is any other, the keyboard doesn't appear.

            M 1 Reply Last reply
            0
            • ivanicyI ivanicy

              @mostefa No, I want to show the system keyboard ( I am running the program in a tablet). I have observed that if the echoMode property of the QLineEdit is "password" when I push on it, the windows keyboard appears automatically, but, if the echoMode property is any other, the keyboard doesn't appear.

              M Offline
              M Offline
              mostefa
              wrote on last edited by
              #6

              @ivanicy said in Show keyboard when QTextEdit is activated:

              @mostefa No, I want to show the system keyboard ( I am running the program in a tablet). I have observed that if the echoMode property of the QLineEdit is "password" when I push on it, the windows keyboard appears automatically, but, if the echoMode property is any other, the keyboard doesn't appear.

              Ok ,

              I don't know if what i will describe will help you , cause in my case i was not using android , i was a virtual keyboard on imx6 embedded card,

              The Qt Doc speak about RequestSoftwareInputPanel

              This enum describes under what circumstances a software input panel will be requested by input capable widgets.

              to know how to use this enum , you can get inspired from this post:

              https://forum.qt.io/topic/20313/how-to-set-qstyle-requestsoftwareinputpanel-to-qstyle-rsip_onmouseclick

              I hope this can help you!

              I have just another question :

              Have you the problem with all input widgets , (such as : QLineEdit, QTextEdit..) or just with QTextEdit?

              ivanicyI 1 Reply Last reply
              0
              • M mostefa

                @ivanicy said in Show keyboard when QTextEdit is activated:

                @mostefa No, I want to show the system keyboard ( I am running the program in a tablet). I have observed that if the echoMode property of the QLineEdit is "password" when I push on it, the windows keyboard appears automatically, but, if the echoMode property is any other, the keyboard doesn't appear.

                Ok ,

                I don't know if what i will describe will help you , cause in my case i was not using android , i was a virtual keyboard on imx6 embedded card,

                The Qt Doc speak about RequestSoftwareInputPanel

                This enum describes under what circumstances a software input panel will be requested by input capable widgets.

                to know how to use this enum , you can get inspired from this post:

                https://forum.qt.io/topic/20313/how-to-set-qstyle-requestsoftwareinputpanel-to-qstyle-rsip_onmouseclick

                I hope this can help you!

                I have just another question :

                Have you the problem with all input widgets , (such as : QLineEdit, QTextEdit..) or just with QTextEdit?

                ivanicyI Offline
                ivanicyI Offline
                ivanicy
                wrote on last edited by
                #7

                @mostefa Thank you for your answer. I am running the app in a Windows tablet. The problem is with all input widgets. Only when this widgets are password echoMode, it works correctly. I will try your solution, and I hope it to work!

                M 1 Reply Last reply
                0
                • ivanicyI ivanicy

                  @mostefa Thank you for your answer. I am running the app in a Windows tablet. The problem is with all input widgets. Only when this widgets are password echoMode, it works correctly. I will try your solution, and I hope it to work!

                  M Offline
                  M Offline
                  mostefa
                  wrote on last edited by mostefa
                  #8

                  @ivanicy said in Show keyboard when QTextEdit is activated:

                  @mostefa Thank you for your answer. I am running the app in a Windows tablet. The problem is with all input widgets. Only when this widgets are password echoMode, it works correctly. I will try your solution, and I hope it to work!

                  Hi again @ivanicy

                  I think that you are having this Qt bug in windows tablet !

                  1 Reply Last reply
                  0
                  • Vinod KuntojiV Offline
                    Vinod KuntojiV Offline
                    Vinod Kuntoji
                    wrote on last edited by
                    #9

                    @ivanicy ,

                    Whenever if you click inside the textedit, application will show the on screen keyboard.
                    Try this code.

                    MainWindow::MainWindow(QWidget *parent) :
                    QMainWindow(parent),
                    ui(new Ui::MainWindow)
                    {
                    ui->setupUi(this);
                    connect(ui->textEdit,SIGNAL(selectionChanged()),this,SLOT(SLT_TextEditActivated()));
                    connect(this,SIGNAL(SGN_ShowKeyboard()),this,SLOT(SLT_ShowKeyboard()));

                    }
                    void MainWindow::SLT_ShowKeyboard(){
                    qDebug()<<"Showing Keyboard"<<endl;
                    QProcess *myProcess = new QProcess(this);
                    myProcess->startDetached("C:\Windows\System32\osk.exe");
                    }

                    void MainWindow::SLT_TextEditActivated(){
                    qDebug()<<"TextEdit Activated"<<endl;
                    emit SGN_ShowKeyboard();
                    }

                    C++, Qt, Qt Quick Developer,
                    PthinkS, Bangalore

                    ivanicyI 1 Reply Last reply
                    1
                    • Vinod KuntojiV Vinod Kuntoji

                      @ivanicy ,

                      Whenever if you click inside the textedit, application will show the on screen keyboard.
                      Try this code.

                      MainWindow::MainWindow(QWidget *parent) :
                      QMainWindow(parent),
                      ui(new Ui::MainWindow)
                      {
                      ui->setupUi(this);
                      connect(ui->textEdit,SIGNAL(selectionChanged()),this,SLOT(SLT_TextEditActivated()));
                      connect(this,SIGNAL(SGN_ShowKeyboard()),this,SLOT(SLT_ShowKeyboard()));

                      }
                      void MainWindow::SLT_ShowKeyboard(){
                      qDebug()<<"Showing Keyboard"<<endl;
                      QProcess *myProcess = new QProcess(this);
                      myProcess->startDetached("C:\Windows\System32\osk.exe");
                      }

                      void MainWindow::SLT_TextEditActivated(){
                      qDebug()<<"TextEdit Activated"<<endl;
                      emit SGN_ShowKeyboard();
                      }

                      ivanicyI Offline
                      ivanicyI Offline
                      ivanicy
                      wrote on last edited by
                      #10

                      @Vinod-Kuntoji It could be a temporal solution. This solution shows this keyboard:

                      0_1510143694966_teclado malo.png

                      but, it shows the administrator window before open it. I want to show the pop-up keyboard:

                      0_1510143761725_teclado bueno.png

                      that is shown automatically. This keyboard only appears when the QLineEdit has "password" echoMode.

                      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