focus out event and cursor issue
Hello forum,
i have a line edit and i want to do some validation check upon the focus out event. If the validation returns a false i show a message box set the focus back to the line edit and the cursor as well. Otherwise the focus moves along with the cursor to the other widget in the layout.I am over-ridding the focusOutEvent() function as follows:
This is the minimal example i think
Code:
void H3DNodeDEFLineEdit
::focusOutEvent(QFocusEvent *event
) {
if(event->reason() == Qt::TabFocusReason)
{
msgBox.setText("Tab for the focus out event");
msgBox.exec();
}
}
Now i am having the following behavior:
With the tab key i get the message box and the focus moves to another widget along with the cursor. But the current line edit still holds the focus and the cursor. How to remove this ?
Thanks
Sajjad
Re: focus out event and cursor issue