Start by thinking about making each stacked panel a separate QWidget derivative with a separate class definition and implementation then your main window need only create thirty objects and add them to the QStackedWidget. These thirty object need only be created when they are needed, i.e. when they are requested the first time, and can also be deleted if they become unused. Only the front-most page has be created at start up.
Then think about what is common between your panels and how you might share those elements between panels.
Bookmarks