Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

active resizing of widgets inside mainwindow

I have a few widgets in a main window. enter image description here i want the user to be able to resize the widgets inside the window as they please, just like how one would resize the main window. Do I have to make a layout container to enable this? or ....layout? Buh the layout contains are static once the window is rendered. In the picture the three widgets should be enable with resizing such that the user can drag their sides/corners to expand or minimize the widget size.

like image 815
PeterG Avatar asked Nov 22 '11 20:11

PeterG


1 Answers

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):

enter image description here

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.

like image 179
Morten Kristensen Avatar answered Sep 21 '22 00:09

Morten Kristensen