M
M
maaGames2022-01-10 11:45:57
Qt
maaGames, 2022-01-10 11:45:57

Is it possible to bind the size of widgets to the grid?

I would like to make a pixel-perfect design with a beautiful background, etc. etc.
I set the desired grid size in the form designer, for example, 10 pixels. And I do the position and size of the element with reference to the grid (snap checkboxes are enabled). It can be seen that the position of the control is attached to the grid, and the dimensions are 1 pixel larger. And so with all controls. It turns out that if I insert a 30*30 pixel image into a 31*31 pixel button, the edge will stick out, or the image will stretch to this pixel and the result will be a non-pixel-perfect soap.
61dbf18287e32376382042.png

Picture button. In one case, the button is 1 pixel wider and taller than the image. Those. this is the real width of the control, and "minus 1 when rendering".
61dc035695c9e250930274.png
61dc035c25695677723006.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question