My problem is:


I want to catch focus-out event from some QDateEdits
This works fine if one of their siblings, which are not QDateEdits, is the next who gets focus.
But if the focus is handed over to some other widget my program ends up in a loop where
the QDateEdit who lost focus seems to go on loosing focus forever.


This is essensially how my eventFilter looks...........


bool MyWidget::eventFilter( QObject *obj, QEvent *ev )
{

if(obj == myDateEdit ){

if(ev->type() == QEvent::FocusOut){

bool ok = true;

if(<some condotion>) ok = false;

if(!ok) QMessageBox::information(0, "Message", "Condition is met","Ok");

((QDateEdit*)obj)->clearFocus();
return true;
} else return false;
}
else return QWidget::eventFilter(obj,ev);
}


How can I detect the situation where focus is handed over to some widget that is not a sibling?