title: How to detect that my application lost focus in Qt?
body: <p>I'm displaying a popup window when the mouse cursor is over a certain widget and I'd like to hide this popup when the mouse leaves the widget.</p>
  
  <p>To do it, I reimplemented <code>leaveEvent()</code>. This seems to work in all cases except when switching to another application by <code>Alt+Tab</code>. I figured out that I probably need to catch another event, but somehow I can't find the proper one. Can you suggest one?</p>