'Change the centralWidget's content

I'm begginer with qt and I have many questions.

One of them is how can I change the centralWidget's content. I have my main.py which is a QMainWindow and contains my "menu" of my software. When I click on the "Validation" button I want change the centralWidget to show something else like the following exemple :

Application menuApplication frame 2

How would you keep just one QMainWindow and change every time I need the centralWidget ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source