title: Qt5 Stacked Widgets
body: <p>I created a <em>Qt</em> stacked widget that has 2 pages. The first page (<code>stackedWidgetPage1</code>) has 1 label and 1 button. The second page (<code>stackedWidgetPage2</code>) has 1 label. When I press the button the below code runs. The code is supposed to change the currently visible page from  page 1 to page2. But, when the code runs, the label gets "cut" in half. The expected result is that page 1 would be completely hidden and page 2 would be completely visible.</p>
  
  <pre class="lang-cpp prettyprint-override"><code>void MainWindow::on_pushButton_clicked()
  {
      ui-&gt;stackedWidgetPage1-&gt;hide();
      ui-&gt;stackedWidgetPage2-&gt;show();
  }
  </code></pre>
  
  <p>page1<img src="https://i.stack.imgur.com/2mb9k.png" alt="page1"></p>
  
  <p>page2<img src="https://i.stack.imgur.com/RJGw6.png" alt="page2"></p>
  
  <p>program started<img src="https://i.stack.imgur.com/zdh1R.jpg" alt="program started"></p>
  
  <p>after I clicked the button<img src="https://i.stack.imgur.com/wGnfC.png" alt="after i clicked the button"></p>