title: Qt Layered Widget Switch Focus
body: <p>I am working with a project which consists of one big widget which has a collection of children widgets.  Two of those children widgets are titled 'File Explorer' and 'Project Explorer'.</p>
  
  <p>Because of the nature of the project, the widgets can be layered on top of each other, causing Qt to auto-tab the widgets, giving the user the opportunity to select either widget.</p>
  
  <p>Example:</p>
  
  <p><a href="https://i.stack.imgur.com/WyTbQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WyTbQ.png" alt="Layered Widgets"></a></p>
  
  <p>I would like to have some segment of code that switches which of these two widgets are on top.  Since I'm working in the main, each is declared as a pointer to the widget in question.</p>
  
  <p>I have tried:</p>
  
  <pre><code>mFileExplorer-&gt;setFocus();
  mFileExplorer-&gt;raise();
  mFileExplorer-&gt;show();
  mFileExplorer-&gt;setFocus();
  </code></pre>
  
  <p>Even if I hide the first widget with</p>
  
  <pre><code>mProjectExploerer-&gt;hide();
  mProjectExplorer-&gt;close();
  </code></pre>
  
  <p>I am still left unable to bring the file explorer to the top.  Would this be possible to do in Qt and if so, how?</p>