title: Do I need to setParent to nullptr before deleting QWidget that's owned by QStackedWidget
body: <p>I have a QStackedWidget which has a bunch of static &quot;pages&quot; but in a couple of cases one page needs to be recreated when it's switched to. Currently I have something like this:</p>
  <pre><code>void InsetNavigator::Navigate(InsetPage *page)
  {
      auto current_page = qobject_cast&lt;InsetPage*&gt;(stacked_widget_-&gt;currentWidget());
      auto current_idx = stacked_widget_-&gt;currentIndex();
      current_page-&gt;MadeHidden();
      stacked_widget_-&gt;removeWidget(current_page);
      current_page-&gt;setParent(nullptr);
      delete current_page;
      stacked_widget_-&gt;insertWidget(current_idx -1, page);
      stacked_widget_-&gt;setCurrentWidget(page);
      page-&gt;MadeVisible();
  }
  </code></pre>
  <p>My question is, do I need to bother with reparenting the current page to a nullptr before deleting it, or can I just delete the current_page and the QStackedWidget will handle the fact that it's been deleted for me? I don't know if leaving the stacked widget as the parent but deleting the pointer will cause issues.</p>