When does QMainWindow::setCentralWidget() destroy the old central widget? I'm calling setCentralWidget() from a slot that's a method of the old central widget, and it's crashing. Should I not do that?

Instead, I guess I'd create a wrapper or container widget that remains the central widget forever, and manages the switch. Or perhaps instead of calling setCentralWidget() directy, emit a signal caught by some other object (subclass QMainWindow?) to do the change?

Thanks

Reed