I tried using this way but I did not succeed, the focus disappears and does not go to the next.

Qt Code:
  1. void Login::keyPressEvent(QKeyEvent *event)
  2. {
  3. if(event->key()==Qt::Key_Enter)
  4. {
  5. this->nextInFocusChain()->setFocus();
  6.  
  7. }
  8. }
To copy to clipboard, switch view to plain text mode 

thanks for help!