Layout Horizontally
-
wrote on 7 Oct 2010, 06:05 last edited by
I think that YourTreeView->setMaximumSize could help you with what you want
-
wrote on 7 Oct 2010, 08:56 last edited by
Try to use horizontalStretch
-
wrote on 7 Oct 2010, 12:02 last edited by
Thanks for the answers. Sorin's answer works if you want one of the QTreeViews not to get bigger than a certain size (like in my case). Denis Kormalev's answer is good if you want to keep them proportionate to each other.
Thanks!
-
wrote on 7 Oct 2010, 12:51 last edited by
Or you can use a splitter and let the user choose the relative sizes of the tree views.
-
wrote on 7 Oct 2010, 14:00 last edited by
Good idea
-
wrote on 17 Mar 2011, 14:56 last edited by
Hi.
My situation is exactly the same and i like to use QSplitter in this scenario.But HOW do i achieve this with QDesigner???
In the "Layout" submenue of the context menu of QMainWindow in the object view, the two optiones with splitter are grey/inactive - in the toolbar, too. wtf?
How can i actually use them?
And yes, there is one widget inside "centralwidget" - two widgets dont help either.
Thanks
L.PS: Using QDesigner 4.7.0 on Windows.
-
wrote on 17 Mar 2011, 15:35 last edited by
The splitter itself is a widget.
SO select the widgets you want to use in the splitter, layout them by the splitter and put a V or HBoxLayout on the main window.
Or use the splitter as central widget. -
wrote on 17 Mar 2011, 16:59 last edited by
Hi Gerolf.
Thanks for your answer.But in my opionion you missed the point. Sorry. But i forgot to mention, there is no Splitter widget in QDesigner wigdet toolbox!
The question remains, how do i do this with QDesigner 4.7.0 ?
Or do i just dont get it?
Thanks
Lars -
wrote on 17 Mar 2011, 17:06 last edited by
Got the "Form" menu and select "Lay Out Horizontally in a Splitter".
And read "this":http://doc.qt.nokia.com/4.7/designer-quick-start.html, "this":http://doc.qt.nokia.com/4.7/designer-layouts.html and "this":http://doc.qt.nokia.com/4.7/designer-manual.html
-
wrote on 17 Mar 2011, 17:38 last edited by
Ok, got it now.
I didnt know that i actually need two "layouts" in the right order. (Though the splitter is no real layout, i know).
First the splitter "layout" on the two wigdets. Then the layout of the main window (for dynamic resizing of the widgets).
A always applied the layout of the main window first, but then your stuck. And there is no splitter option in the first place.
Thanks a lot.
-
wrote on 17 Mar 2011, 17:40 last edited by
Nice, that it works now.
You're right, the order of layouts is important, but easy to memorize: Always layout from the inner pieces to the outer, single widgets to groups, groups to bigger groups and the toplevel layout at the very end.
-
wrote on 17 Mar 2011, 17:45 last edited by
And now Gerolfs post makes sense to me.
Sorry.