Initial size of widget in splitter
-
wrote on 10 Apr 2013, 08:29 last edited by
Hi,
Given a vertical splitter with two widgets in it, how do I set the initial height of the top widget to a certain value. The bottom widget should occupy the rest of the space.
I want to do this in Qt creator so I can see the form I create.
W.
-
wrote on 11 Apr 2013, 04:52 last edited by
I didn't find this option for splitters in QtCreator. But in code you can use "setStretchFactor()":http://qt-project.org/doc/qt-5.0/qtwidgets/qsplitter.html#setStretchFactor
-
wrote on 11 Apr 2013, 07:20 last edited by
QtDesigner is probably what you mend? No such option I'm afraid. Have been searching for it as well. Didn't find it.
-
wrote on 11 Apr 2013, 08:18 last edited by
We can set the stretch factor of the widgets in the splitter, but this hardly doesn't seem to make any difference. See my question at http://qt-project.org/forums/viewthread/26584/. No mather what policy or size values I set, the widgets/splitter does behave very odd. Maybe it's a bug.
-
wrote on 11 Apr 2013, 10:55 last edited by
I remember that I also fought against such strange situations ...
I never found some really nice solution to it ...I could only remember that the "sizeHint()" plays an important role in layouting, which on the other hand can't be modified by properties ... so, I had to subclass some things just to fix layouting °° (or using fixed sizes)
Especially this was the case with QListView/QTreeView which had a really strange default implementation of sizeHint() ... probably some similar is/was in GraphicsView ....
1/5