Basically I have a QTabWidget. At first it has a form widget, widget1. After that form is done being interacted with, the new widget2 form should take over that same tab.
I thought tabWidget->setCurrentWidget(new widget2()); would work, but it’s basically an overload for setCurrentIndex(int).
Does anyone know of a way to do this?
You can use a
QStackedWidgetfor this type of thing, in a tab or elsewhere.Put all the widgets you’ll want to display in that tab inside a single
QStackedWidget, and place that stacked widget in a tab.Here’s a quick’n’dirty demo: