So I have the following code:
Qt Code:
void Classy::on_checkBox_pressed() { qDebug() << "Box Pressed"; layout->addWidget(stackedWidget); stackedWidget->setCurrentWidget(sickWidget); stackedWidget->setLayout(layout); stackedWidget->show(); }To copy to clipboard, switch view to plain text mode
Layout is a QVBoxLayout that I defined in public under classy.
stackedWidget is a stackedWidget that I have as as stacked Widget in my ui.
sickWidget is a "page" (QWidget) that has more objects underneath it.
i looked at all kinds of documentation for this including this thread: http://www.qtcentre.org/threads/6878...qstackedwidget
(I have w.show(); inside of main.cpp) However whenever I select the checkbox in my program it crashes and I don't understand what I'm doing wrong as I'm trying my best to follow the example in the Qt documentation under QStackedWidget. Can anyone help me?
Thank you again to everyone.
Bookmarks