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. QSplitter: setStretchFactor problem

QSplitter: setStretchFactor problem

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 509 Views 1 Watching
  • 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.
  • sitesvS Offline
    sitesvS Offline
    sitesv
    wrote on last edited by sitesv
    #1

    Hi!
    Two vertical widgets with splitter between them.

    ui->splitter->setStretchFactor(0, 1);
    ui->splitter->setStretchFactor(1, 3);
    

    This code works fine.

    If I add, for example, QLabel to the second widget and make a vertical layout, that code works fine again.
    111.png

    But, if I also add QTextBrowser to the vertical layout of second widget , that code doesn't works.
    222.png

    All settings are default.
    Whats wrong with the settings?

    Christian EhrlicherC 1 Reply Last reply
    0
    • sitesvS sitesv

      Hi!
      Two vertical widgets with splitter between them.

      ui->splitter->setStretchFactor(0, 1);
      ui->splitter->setStretchFactor(1, 3);
      

      This code works fine.

      If I add, for example, QLabel to the second widget and make a vertical layout, that code works fine again.
      111.png

      But, if I also add QTextBrowser to the vertical layout of second widget , that code doesn't works.
      222.png

      All settings are default.
      Whats wrong with the settings?

      Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @sitesv said in QSplitter: setStretchFactor problem:

      Whats wrong with the settings?

      The QTextBrowser is expanding by default

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      sitesvS 1 Reply Last reply
      0
      • Christian EhrlicherC Christian Ehrlicher

        @sitesv said in QSplitter: setStretchFactor problem:

        Whats wrong with the settings?

        The QTextBrowser is expanding by default

        sitesvS Offline
        sitesvS Offline
        sitesv
        wrote on last edited by
        #3

        @Christian-Ehrlicher said in QSplitter: setStretchFactor problem:

        The QTextBrowser is expanding by default

        I changed QTextBrowser size policy to the "preffered"... Result is the same.

        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