title: How to know if a QLineEdit got focus?
body: <p>I want to be able to know if in the <code>QLineEdit</code> it was a click. So I guess I should reimplement the following function(??):</p>
  
  <pre><code>void QLineEdit::focusInEvent ( QFocusEvent * e )   [virtual protected]
  </code></pre>
  
  <p>How should I do that?</p>
  
  <p>Also, please tell me how to use <code>focusInEvent()</code> function in order to know if <code>QLineEdit myEdit;</code> object got focus.</p>
  
  <p><strong>EDIT:</strong> I have written the following function:</p>
  
  <pre><code>bool LoginDialog::eventFilter(QObject *target, QEvent *event)
  {
      if (target == m_passwordLineEdit)
      {
          if (event-&gt;type() == QEvent::FocusIn)
          {
              if(checkCapsLock())
              {
                  QMessageBox::about(this,"Caps Lock", "Your caps lock is ON!");
  
              }
              return true;
  
          }
      }
      return QDialog::eventFilter(target, event);
  }
  </code></pre>
  
  <p>And have registered <code>m_passwordLineEdit</code> in <code>LoginDialog</code> class constructor like this:</p>
  
  <pre><code>m_passwordLineEdit-&gt;installEventFilter(this);
  </code></pre>
  
  <p>And it's falling into an infinite loop of MessageBox-es. Please help me to resolve this situation.  Actually I would like to implemet this function with a pop-up window (not with a <code>QMessageBox</code>). Is it OK to use <code>QLabel</code> for that need?</p>