Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Widgets proportions in QSplitter
Forum Updated to NodeBB v4.3 + New Features

Widgets proportions in QSplitter

Scheduled Pinned Locked Moved Unsolved General and Desktop
qsplitterstretchsizepolicy
1 Posts 1 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    voltron
    wrote on last edited by
    #1

    I have QListWidget and QTextBowser aligned vertically inside QSplitter, QListWidget on the top and QTextBowser at the bottom. I want to have QListWidget occupy 1/3 of the available space and QTextBowser 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 the QListWidget to 1 and verticalStretch property of the QTextBrowser 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?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved