Widgets proportions in QSplitter
-
I have
QListWidget
andQTextBowser
aligned vertically insideQSplitter
,QListWidget
on the top andQTextBowser
at the bottom. I want to haveQListWidget
occupy 1/3 of the available space andQTextBowser
occupy remaining 2/3 at the start. Later user may change widget sizes as he wants by dragging QSplitter border.UI was created with the QtDesigner, so I set
verticalStretch
property of theQListWidget
to 1 andverticalStretch
property of theQTextBrowser
to 2. But this does not help, when I run application QSplitter space divided between both widgets in equal proportions.I also tried to set proportions programmatically using following code
self.splitter.setStretchFactor(0, 1) self.splitter.setStretchFactor(1, 2)
but it also does not work.
Am I miss something or doing something wrong? Any ideas how to make top widget 2 times smaller than bottom widget?