USe Stackwidget in .ui file of your project it will become very easy to you for understanding....