Qt Code:
  1. void Classy::on_checkBox_pressed()
  2. {
  3. qDebug() << "Box Pressed";
  4. layout->addWidget(stackedWidget);
  5. stackedWidget->setCurrentWidget(sickWidget);
  6. //stackedWidget->setLayout(layout); // This should not be done, layout of stackedWidget is managed internally by QStackedWidget.
  7. //stackedWidget->show(); // Need not show this directly, just show the top level widget which contains the stackedWidget.
  8. }
To copy to clipboard, switch view to plain text mode