Often times while using QT designer I find myself needing to re-size things either by shrinking or expanding them. Whenever I try to do this the program does not allow me and simply reverts to the original default size it gives me when placing the object within my window, regardless of the layout I have. Why does it do this? And is it possible to change this so that I can re-size things to my own will without restrictions? I have been trying to learn how to properly use QT designer, but I can't find much information on this on the internet.
Anything placed in a "Layout" will be automatically resized to fit in the layout. This is so Qt can do automatic resizing if the user resizes the form at run-time.
If you want absolute placement, the simplest way is just don't use the layouts, place things directly on the MainForm. You could also place a "container" (Group box, Tab widget) inside a layout and place components inside that; the containers don't act like Layouts. It's all in the manual.
As thuga mentioned, you can set the minimum and maximum size and the size policy to override the automatic sizing when the widget is in a layout. This would be ok for a couple of particular widgets among an otherwise auto sizing group.
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