Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QMainWindow swap Central Widget or QStackedWidget
sandro4912 last edited by
I have the following Situation:
A Widget of type A which is like a Dialog. Which can only get accepted.
A Widget of type B which runs the main application
A Widget of type C which reports the Outcome of the main widget. It is also like a Dialog with the choice to start a new B or quit the program.
So my program flow is :
A gets accepted.
Dsiplay C (show the result of B)
Have the option to start again a new B (Some aspects of B are random so it has to get created new everytime we switch back).
I was wondering how to organize the flow of the programm the best?
Putting them in a
-> I tryed this approach it seems to work but A and C don't follow the size rules since they are based on
QDialog. So in Short evrytime I switch
centralWidgetthe QMainWindow jumps to annother place and resizes. Even with
QStackedWidgetand get the old B and C out at the time to replace them with new ones?
Annother option im not aware off.
I hope you can push me in the right direction here.
Why do you need to put them out of the stacked widget ?
Implement them so that you can refresh/reset them so you only have one instance of each and be done with it.