Widgets proportions in QSplitter
-
I have
QListWidgetandQTextBowseraligned vertically insideQSplitter,QListWidgeton the top andQTextBowserat the bottom. I want to haveQListWidgetoccupy 1/3 of the available space andQTextBowseroccupy 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
verticalStretchproperty of theQListWidgetto 1 andverticalStretchproperty of theQTextBrowserto 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?