Have you checked where it crashes?

Alternatively to an event filter you could also try reimplementing QWidget::focusOutEvent(), i.e. derive a new class from QLineEdit and overwrite the virtual method.

Cheers,
_