PDA

View Full Version : Tool keyboard wont appear when I click on line edit again



020394
4th June 2013, 02:55
Hello All, I am new to Qt and I am trying to make a program where when i click the lineedit , a pop up box would show up below . I am able to do that by using


void MainWindow::on_NRIC_cursorPositionChanged(int arg1, int arg2){
popupKeyboard();//Showing the popup keyboard
}


But after i close the popup and click on the QLineEdit , The popup does not show at all .

There is another problem , When the text fill is filled with letters,Whenever I press Enter on the popup menu, it would take many clicks to close



QFrame* popupNumpadBed = new QFrame(this, Qt::Tools| Qt::FramelessWindowHint);
popupNumpadBed->resize(600,500);
popupNumpadBed->setAttribute( Qt::WA_TranslucentBackground );
QPushButton *BedEnter= new QPushButton( popupNumpadBed );
BedEnter->setText("Enter");
BedEnter->setGeometry(450,256.66666, 150, 53.33333);
BedEnter->setFocus();
connect(BedEnter, SIGNAL(clicked()), popupNumpadBed, SLOT(hide()));



Please Help Thank you

wysota
4th June 2013, 06:56
cursorPositionChanged() is not triggered when you click anything but when... cursor position changes. If you want to have a virtual keyboard then the proper approach is to implement an input context plugin.

020394
4th June 2013, 07:45
cursorPositionChanged() is not triggered when you click anything but when... cursor position changes. If you want to have a virtual keyboard then the proper approach is to implement an input context plugin.
Thanks for the immediate response , Mind if i ask , How do we use the input context plugin method ? I mean how do we use it ?

wysota
4th June 2013, 13:04
Qt will take care of using it. You just need to provide it.

020394
5th June 2013, 02:34
I researched about inputcontextplugins but found minimal relevant searches . I tried including QInputContextplugins but to no avail , i cant get it to build . And for the codings of inputcontext pluggin, I am not really sure of how to implement it . Are you able to show me an example so i can read into it ?Thanks

wysota
5th June 2013, 07:02
As far as I remember there is an example in the docs on how to implement a simple input context plugin.

Here you go: http://qt-project.org/doc/qt-4.8/tools-inputpanel.html