title: How to remove focus from QLineEdit
body: <p>I am developing a cpp/Qt tool.<p>When I click on a QLineEdit field, its frame turns to a different color and the cursor starts blinking.<p>When I type on Return in the field, I want its cursor to stop blinking and its frame color to default back to normal.<p>I can intercept the Return Pressed, but when I then start the clearFocus() command, the keyboard input does not come anymore to the QLineEdit field (which is the behaviour I am expecting), but its frame doesn't go back to the default color and the cursor continues blinking. How to really remove focus from the field (i.e.: No cursor blinking anymore and frame back to default color) ?<p></p>
  
  <p>=== EDIT ===<br>
  Here is the code:</p>
  
  <pre><code>void myQLineEditClass::keyPressEvent(QKeyEvent *e)
  {
      if(e-&gt;text().length()&gt;0)
      {
          int asciiVal = e-&gt;text().at(0).toAscii();
  
          if (asciiVal==3||asciiVal==13)
          {
              MGlobal::displayInfo(MQtUtil::toMString(QString().sprintf("Focus cleared"))); // -&gt; this is properly displayed
  
              clearFocus();
          }
      }
      QLineEdit::keyPressEvent(e);
  }
  </code></pre>
  
  <p>Thanks. </p>