i tried that but nothing happens so i decided to try the one above since it's the closest that i've gotten so far
Added after 6 minutes:
i tried doing this
void MainWindow::on_actionReplace_triggered()
{
ui->stackWidget->addWidget(ui->newWidget);
layout->addWidget(ui->stackWidget);
setLayout(layout);
}
void MainWindow::on_actionReplace_triggered()
{
ui->newWidget = new QWidget;
ui->stackWidget = new QStackedWidget;
ui->stackWidget->addWidget(ui->newWidget);
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(ui->stackWidget);
setLayout(layout);
}
To copy to clipboard, switch view to plain text mode
It gives this error
QWidget::setLayout: Attempting to set
QLayout "" on MainWindow
"MainWindow", which already has a layout
QWidget::setLayout: Attempting to set QLayout "" on MainWindow "MainWindow", which already has a layout
To copy to clipboard, switch view to plain text mode
Bookmarks