Show keyboard when QTextEdit is activated
-
wrote on 27 Oct 2017, 06:19 last edited by
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!!
-
wrote on 27 Oct 2017, 07:26 last edited by
Are you using QtWidgets or QtQuick (QML)?
-
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?wrote on 7 Nov 2017, 11:29 last edited by@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.
-
@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.
wrote on 7 Nov 2017, 12:59 last edited by@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:
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?
-
@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:
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?
wrote on 8 Nov 2017, 07:33 last edited by@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!
-
@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!
wrote on 8 Nov 2017, 07:46 last edited by mostefa 11 Aug 2017, 07:46@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 !
-
wrote on 8 Nov 2017, 09:29 last edited by
@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();
} -
@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();
}wrote on 8 Nov 2017, 12:23 last edited by@Vinod-Kuntoji It could be a temporal solution. This solution shows this keyboard:
but, it shows the administrator window before open it. I want to show the pop-up keyboard:
that is shown automatically. This keyboard only appears when the QLineEdit has "password" echoMode.