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. Initial size of widget in splitter
Forum Updated to NodeBB v4.3 + New Features

Initial size of widget in splitter

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 6.4k 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.
  • W Offline
    W Offline
    Woomla
    wrote on 10 Apr 2013, 08:29 last edited by
    #1

    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
    0
    • Q Offline
      Q Offline
      qxoz
      wrote on 11 Apr 2013, 04:52 last edited by
      #2

      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
      0
      • J Offline
        J Offline
        Jeroentjehome
        wrote on 11 Apr 2013, 07:20 last edited by
        #3

        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
        0
        • W Offline
          W Offline
          Woomla
          wrote on 11 Apr 2013, 08:18 last edited by
          #4

          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
          0
          • S Offline
            S Offline
            sl.sy.ifm
            wrote on 11 Apr 2013, 10:55 last edited by
            #5

            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
            0

            1/5

            10 Apr 2013, 08:29

            • Login

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