You can instead use QToolButton/ button group and use QStackedWidget with it.
It will be more appropriate to ur requirement