StackWidget will certainly accomplish what you want to do. The reason why it is not always used for this kind of thing is because all screens are pre-created at the beginning and always exist. This means that initialization takes a little longer and you are using more resources than you need at any given time.
But, as you say, if this is a simple game, then I donโt see a big problem with it. Just as easily, you can also create an empty layout and change inventory and game panels as needed.
Add your vote to everyone else suggesting using a designer. It is much easier to manipulate layouts, actions, etc., using the constructor, and then through the code.
You can see the design guide here.
So here is what I would suggest:
"battleScreen.ui" - , "inventory.ui". QWidgets QFrames, - .
"Game.ui", QMainWindow.
QStackWidget .
, ...
1) QWidget ( )
2) QWidget .
3) "..."
4) , QWidget : :
5)
6) "".
, .