I have a few widgets in a main window.
![](https://www.eimg.top/images/2020/03/16/14135a626cd00abb7e603aab7b556a1e.jpg)
One thing you could do is to use some QSplitter
's though it isn't directly as nuanced as you pointed out. Have a look at the image (you can drag the handles):
![](https://www.eimg.top/images/2020/03/16/f9d8a9078329670b636250836db98208.png)
Another thing is to place the widgets using absolute coordinates and then detect when the cursor is clicked and dragged on the "edge". Then you calculate how much it should be resized and actually resize the widget according to its position.
You could also have a look at the QMdiArea
and then add your widgets using addSubWindow()
where you also set the window flags.
来源:https://stackoverflow.com/questions/8233263/active-resizing-of-widgets-inside-mainwindow