I'm working on a simple board game in qt, and i have some problem with the layout. I have two players, their health is represented with pixmaps, at the bottom of the screen. It looks now something like this:

Notice, that i would like to keep the health indicators on the opposite sides of the screen, and the button in the middle centered, relative to the screen.
BUT when some of the players loose health, this happens:

If the drawing were not understandable, here, i took some screens:

So the problem is, that the button in the middle starts shifting to one of the edges of the sreen because of the spacers. I understand why it does it, but i simply can't find a solution.
Please if you have any ideas, how i could make this layout work, help me! Thanks in advance!
Make an empty (fully transparent) health indicator pixmap which has the same size as the heart pixmap. Then you can always place three same size health indicator pixmaps for both players.
You can put a Widget where your health indicator should be, set its sizePolicy to a fixed size, and put your health indicator pixmap inside that widget.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With