title: The case of the disappearing QWidgets
body: <p>I've noted some rather inscrutable behaviour from QTabWidget. I'm trying to detach and reattach tabs, and that works fine, except if I programmatically select a widget after reattaching it, all its children disappear! No about of update() or repaint() or whatever seems to make the widgets reappear. You can select a different tab and the re-select the "broken" tab, and the children widgets are automagically visible again.</p>
  
  <p>Below is some (shortened) code that displays the problem.</p>
  
  <pre><code>void MainWindow::test()
  {
      auto tab_widget = pimpl-&gt;tab_widget;
      auto sz = tab_widget-&gt;size();
  
      auto wgt = tab_widget-&gt;currentWidget();
      auto tab_text = tab_widget-&gt;tabText(tab_widget-&gt;currentIndex());
      if(wgt == nullptr)
      return;
  
  
      wgt-&gt;installEventFilter(new GenericQEventFilter(wgt, 
          [=] (QObject *obj, QEvent *event) {
              if(event-&gt;type() == QEvent::Close) {
                  printf("Close Event!!!\n");
                  tab_widget-&gt;addTab(wgt, tab_text);
                  tab_widget-&gt;setCurrentWidget(wgt);
                  // wgt's children are temporarily invisible
                  wgt-&gt;setUpdatesEnabled(true);
                  wgt-&gt;repaint();
                  wgt-&gt;update();
                  qApp-&gt;processEvents(); //NOTHING WORKS!!!
                  return true;
               }
              return false;
          }));
      tab_widget-&gt;removeTab(tab_widget-&gt;currentIndex());
      wgt-&gt;setParent(nullptr);
      wgt-&gt;setVisible(true);
      wgt-&gt;raise();
      wgt-&gt;setFocus();
  }
  </code></pre>
  
  <p>So, just to be clear, I'm attaching an event-fitler to the detached widget in order to pick up the onClose event. The event filter works fine, picks up the event, and reattaches the widget to the tab_widget; however, after reattaching, all the children are invisible or something crazy like that.</p>