title: Crash when child widgets depend on a parent's dependency
body: <pre><code>class MyMainWindow : public QMainWindow
  {
  private:
    SomeDependency someDependency;
  }
  
  class SomeWidget : public QWidget
  {
  public: 
    ~SomeWidget()
    {
      // Use someDependency by getting it from MyMainWindow (or having MyMainWindow pass it in)
    }
  }
  
  MyMainWindow::MyMainWindow(QWidget* parent)
  : QMainWindow(parent)
  {
    SomeWidget* someWidget = new SomeWidget(this);
  }
  </code></pre>
  
  <p>I'm running into a problem with this pattern. <code>MyMainWindow</code> owns <code>SomeDependency</code>. <code>MyMainWindow</code> creates a new <code>SomeWidget</code> on the heap and gives it a parent <code>this</code>. </p>
  
  <p>The destructor of <code>SomeWidget</code> needs to call <code>SomeDependency</code> to do something (say... unregister itself from the dependency when it's dying). This works fine when widgets go away normally.</p>
  
  <p>When the app is killed, however, there's a weird problem. The <code>MyMainWindow</code> destructor is called first. It will clean up <code>SomeDependency</code>. Next, the <code>QMainWindow</code> destructor is called. This will clean up all of its children. It starts deleting its children, which causes <code>SomeWidget</code> to get destroyed. The <code>SomeWidget::~SomeWidget()</code> then calls <code>SomeDependency</code>... but it's been destroyed, so the app crashes.</p>
  
  <p>How can I play by the Qt parent/child memory lifetime rules, but have children get their dependencies from <code>MyMainWindow</code>?</p>