title: Floating sub QMainWindow (QMainWindow as child widget of main QMainWindow)
body: <p>I use a <code>QMainWindow</code> as <strong>child</strong> of my main <code>QMainWindow</code>. By that I get an other area which I can use for dockable widgets (<code>QDockWidget</code>).</p>
  
  <p>According to the following posts this is OK, it also works perfectly for me.</p>
  
  <ol>
  <li><a href="https://qt-project.org/forums/viewthread/17519" rel="nofollow noreferrer">https://qt-project.org/forums/viewthread/17519</a></li>
  <li><a href="http://www.qtcentre.org/threads/12569-QMainWindow-as-a-child-of-QMainWindow" rel="nofollow noreferrer">http://www.qtcentre.org/threads/12569-QMainWindow-as-a-child-of-QMainWindow</a></li>
  </ol>
  
  <p>To make the <code>QMainWindow</code> behaving as a normal widget, I unset the window flag, this trick is mentioned in one of the posts above.</p>
  
  <p>Now I also want to be able to float this child <code>QMainWindow</code> with all its docked widgets. In other words, I want to revert the step "making it a normal widget". Unfortunately,  this does does not work. It is gone from the main window, but not visible at all.</p>
  
  <p>Any way to resolve it?</p>
  
  <pre><code>// this is the child QMainWindow
  if (this-&gt;m_infoAreaFloating)
  {
      // this should give me a floating window besides the main window
      this-&gt;setWindowFlags(Qt::Desktop);
      this-&gt;show();
  }
  else
  {
      // make this compliant as QWidget
      this-&gt;setWindowFlags(this-&gt;windowFlags() &amp; ~Qt::Window);
  }
  </code></pre>
  
  <p>Related: <a href="https://stackoverflow.com/questions/24897261/internal-qwidgets-of-qtabbars-tab">a</a> , <a href="https://stackoverflow.com/questions/24851977/hide-label-text-for-qt-tabs-without-setting-text-to-empty-string">b</a></p>