Maybe dumb question but I failed to google the answer so you might help.
I have a MainWindow in my application. And two completely different widgets that I would need to use as central widget. When application starts central widget is not set. When user click new in the file menu a Dialog appears and let him choose one or the other. Depending on his choice I create the appropriate widget and using setCentralWidget make it the central widget of Main Window class.
Now when user finish work and wants to change mode so to speak he click new again he is asked to save his work and the same Dialog appears for him to choose from.
The previous widget needs to be removed as central widget, deleted and new one created and set. I know how to create and set the central widget but how to remove it safely and delete it safely.
So far I had one central widget per application so MainWindow deleted it when he it self was closed.
Thanks in advance.
Bookmarks