I have to connect focus event from some QLineEdit element (ui->lineEdit) to the method focus(). H
QLineEdit
ui->lineEdit
focus()
I assume you mean connect as in signals/slots, focus event isn't a signal it's a virtual method you have to override in order to change the behavior:
http://doc.qt.io/qt-5/qlineedit.html#focusInEvent