Ok, sorry. Had a long day ;-)
This should work:
#include <QInputMethod>
[slot] void whenKeyboardVisibiliyChanged() {
if (QGuiApplication::inputMethod()->isVisible()) {
yourLineEdit->clearFocus();
}
}
connect(QGuiApplication::inputMethod(), SIGNAL(visibleChanged(), yourObject, SLOT(whenKeyboardVisibiliyChanged())));
Cheers!