Qt Resizing children
-
Is there a standard way of adding an a widget to a window then, setting its initial position and size then if the window is resized having it automatically adjust the size of the children in the window?
I'm asking this because I've spent quite a lot of time doing it myself when the resize event occurs I then adjust children of the window however I thought I'd ask is there is a defined way of getting the system to do this for me?
-
Is there a standard way of adding an a widget to a window then, setting its initial position and size then if the window is resized having it automatically adjust the size of the children in the window?
I'm asking this because I've spent quite a lot of time doing it myself when the resize event occurs I then adjust children of the window however I thought I'd ask is there is a defined way of getting the system to do this for me?
-
@jsulm, the only reason is that my experience with Qt has been on the job where I've learnt it by using it and haven't had any formal instruction.
When I first started working with Qt I created an application that didn't use Qt Creator to define where everything went as the application itself was supposed to be completely dynamic and position widgets at run-time.
I'm keen to learn if there is a way to do what I need using Layouts, I need to be able to place widgets anywhere in the window.
-
@jsulm, the only reason is that my experience with Qt has been on the job where I've learnt it by using it and haven't had any formal instruction.
When I first started working with Qt I created an application that didn't use Qt Creator to define where everything went as the application itself was supposed to be completely dynamic and position widgets at run-time.
I'm keen to learn if there is a way to do what I need using Layouts, I need to be able to place widgets anywhere in the window.
@SPlatten You should really learn to use layouts instead of messing up with manual positioning/sizing.
https://doc.qt.io/qt-5/layout.html -
Just for the record.
The layouts will fix/arrange and scale widgets.You cannot place widgets freely on the form
when in a layout as that would completely goes against of what layout does :)
but you can place the layout as you wish to some degree.