Installing the eventFilter in my own class give me the possibily to handle all kinds of events in one central location. And the Qt documentation doesn't point this as bad habit, nor recomend against it.

Qt Creator use this kind of eventFilter control (src/plugins/coreplugin/locator/locatorwidget.cpp), see line 262.
Qt Code:
  1. // We set click focus since otherwise you will always get two popups
  2. m_fileLineEdit->setButtonFocusPolicy(Utils::FancyLineEdit::Left, Qt::ClickFocus);
  3. m_fileLineEdit->setAttribute(Qt::WA_MacShowFocusRect, false);
  4. m_fileLineEdit->installEventFilter(this);
  5. this->installEventFilter(this);
To copy to clipboard, switch view to plain text mode 

The error persists calling QObject::eventFilter or QDialog::eventFilter.

Oddly enough this same code runs correctly under Qt 5.3.1 in windows. It's seems that it could be related to the linux version of Qt.

I track the error to a QPaintEvent using gdb.

Anyway thanks for the help.