PDA

View Full Version : Resizable layout boxes



NOR
16th April 2008, 11:30
Hi, I'm working on kind of a basic java editor using Qt Jambi (School projec), and it's all been going great so far, but I cant seem to find out how to let the user resize the layout boxes or widgets himself.

Let's say I have two widgets laid out like this:



------------------
| |
------------------ <---- I want the user to be able to drag this divider up and down
| |
------------------


How would I go about doing this? Do I have to wrap the widget in another element? Simply change a layout / widget property I've overlooked?

Thanks,
any help will be highly appreciated!

wysota
16th April 2008, 14:16
Some more info would be required... Are you trying to mimic what Designer does? Why not take its code directly or even use Designer for editing?

jacek
16th April 2008, 15:05
Do I have to wrap the widget in another element?
Yes, you have to add your widgets to a splitter. In Qt Designer you have to select some widgets and choose "Lay out in a splitter" from the menu.

NOR
16th April 2008, 15:48
Yes, you have to add your widgets to a splitter. In Qt Designer you have to select some widgets and choose "Lay out in a splitter" from the menu.

Thanks!
QSplitter was exactly what I was looking for.
I'm not using Qt Designer, so I guess that's why I had so much trouble figuring out what I needed. =)