I created a Qt stacked widget that has 2 pages. The first page (stackedWidgetPage1
) has 1 label and 1 button. The second page (stackedWidgetPage2
) 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.
void MainWindow::on_pushButton_clicked()
{
ui->stackedWidgetPage1->hide();
ui->stackedWidgetPage2->show();
}
page1
page2
program started
after I clicked the button