{
QLineEdit *isQLineEdit
= static_cast<QLineEdit
*>
(call_object
);
if(call_object != ui->TME_COM_ETHER1_IP1_TXTED) return false;
qDebug("Entering if\n");
if (pevent
->type
() == QEvent::FocusIn) {
qDebug("entering show\n");
virtualkeyboard->show();
return true;
}
else
{
qDebug("entering hide\n");
virtualkeyboard->hide();
return false;
}
}
bool TME_COM::eventFilter(QObject* call_object, QEvent* pevent)
{
QLineEdit *isQLineEdit = static_cast<QLineEdit*>(call_object);
if(call_object != ui->TME_COM_ETHER1_IP1_TXTED) return false;
qDebug("Entering if\n");
if (pevent->type() == QEvent::FocusIn)
{
qDebug("entering show\n");
virtualkeyboard->show();
return true;
}
else
{
qDebug("entering hide\n");
virtualkeyboard->hide();
return false;
}
}
To copy to clipboard, switch view to plain text mode
Yes, Of-course I've called installEventFilter() for the line edits.
"Not working" I mean if I click on line edit VKB is not displaying.
So as you told I put some Debug statements and tried, actually when I open the screen itself it's entering this event filter function. The program is not waiting till I click on lline edit. As soon as I open the TME_COM screen it's entering the event filter function. But I don't want that, whenever I click on line edit it should enter the event filter function.
In the output It's printing following Debug statements
Entering if
Entering hide
Entering if
Entering hide
and I'm getting one warning," unused variable isQlineEdit". What should I do to display the VKB for click on line edit?
Bookmarks