Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Initial size of widget in splitter

    General and Desktop
    4
    5
    5984
    Loading More Posts
    • 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.
    • W
      Woomla 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.

      1 Reply Last reply Reply Quote 0
      • Q
        qxoz 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

        1 Reply Last reply Reply Quote 0
        • Jeroentjehome
          Jeroentjehome 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.

          Greetz, Jeroen

          1 Reply Last reply Reply Quote 0
          • W
            Woomla 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.

            1 Reply Last reply Reply Quote 0
            • S
              sl.sy.ifm 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 Reply Last reply Reply Quote 0
              • First post
                Last post