title: Knowing inside a leaveEvent which QWidget is entered
body: <p>I'm implementing a QDialog which shows up when another QWidget (a QFrame) is hovered and destroyed when the mouse cursor leaves the QFrame. I do the construction and destruction via the enterEvent and leaveEvent (inside the QFrame):</p>
  
  <pre><code>void Frame::enterEvent(QEvent *) {
      m_dialog = new Dialog(this);
  }
  
  void Frame::leaveEvent(QEvent *) {
      m_dialog-&gt;deleteLater();
  }
  </code></pre>
  
  <p>The dialog moves itself right below the frame when it's constructed. So far so good, but the mouse cursor also has to be able to go to the dialog. I thought about using underMouse() like so:</p>
  
  <pre><code>void Frame::leaveEvent(QEvent *) {
      if (! m_dialog-&gt;underMouse()) {
          m_dialog-&gt;deleteLater();
      }
  }
  </code></pre>
  
  <p>but the problem is that inside Frame::leaveEvent, m_dialog->underMouse() is always false, even if the mouse is moved right onto it.</p>
  
  <p>How can I know, inside Frame::leaveEvent, if the mouse is now on the dialog or somewhere else?</p>