title: How to detect if focus shift from a widget inside a QWidget to one outside?
body: <p>I'm programming in Python using Qt with PySide and I have custom QWidget defined in a file called editor.py which is inserted in my ui in windowUi.py using the promotion method in the Qt Designer.</p>
  
  <p>The custom QWidget class defined in editor.py doesn't do much besides using Elixir to edit items in a sqlite3 database and importing a ui file (editor.ui). Inside editor.ui there are a couple of QLineEdits and QDateTime widgets.</p>
  
  <p>This widget is originally hidden in the main window and showed when needed. So far so good, but the problem is that I cannot make it hide when not needed. I decided that the widget is not needed when the user clicks anywhere else in the main window that is not the editor widget imported, that is, focus shift from the QWidget.</p>
  
  <p>I looked upon this question: <a href="https://stackoverflow.com/questions/5512630/qwidget-focusoutevent-not-recieved">QWidget focusOutEvent not received</a> and realized that the QWidget is really not getting focus.</p>
  
  <p>If I call setFocusPolicy(StrongFocus) on it then I can make it hide if, and only if, the user clicks on the QWidget background (not on any widget inside it) and then clicks outside.</p>
  
  <p>The question is then, how can I make it such that when the user clicks outside of this widget, shifting focus from any QLineEdit or QDateTime that's inside it to something else, the QWidget then hides itself?</p>