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. Layout problems
Qt 6.11 is out! See what's new in the release blog

Layout problems

Scheduled Pinned Locked Moved Solved General and Desktop
qt5.5qgridlayout
8 Posts 2 Posters 2.9k 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.
  • G Offline
    G Offline
    GrahamLa
    wrote on last edited by
    #1

    Hi
    I have a grid layout that contains 2 vbox layouts
    each vbox layout contains a QTableWidget.

    As it stands the space in the grid layout is shared equally between the two vbox's

    However I want to have the first vbox to have 2/3 of the space but cannot seem to get it to work.

    I have played with the layout stretch factors but cannot seem to find the correct solution

    Please can someone give me some hints.

    Thanks

    1 Reply Last reply
    1
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      Like ?
      alt text

      In the beginning i found the stretch factor pretty odd as im used to %
      but its quite easy.
      The sum of the number is the total (100%) so you simply assign a value to each
      col/row that says how many of the total.
      so in this case it get 2 from 3. ( 2+1)

      1 Reply Last reply
      2
      • G Offline
        G Offline
        GrahamLa
        wrote on last edited by
        #3

        Hi Thanks
        That has clarified some things.
        Can the same be done with a vertical layout?

        mrjjM 1 Reply Last reply
        0
        • G GrahamLa

          Hi Thanks
          That has clarified some things.
          Can the same be done with a vertical layout?

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #4

          @GrahamLa
          Yes they also have stretch factor.
          alt text

          Here top get 3 from 4

          1 Reply Last reply
          1
          • G Offline
            G Offline
            GrahamLa
            wrote on last edited by
            #5

            Hi
            I tried but get this
            0_1545149326993_ea563488-a731-4134-87bd-9627c9fcfbed-image.png

            The widgets take the same space

            mrjjM 1 Reply Last reply
            1
            • G GrahamLa

              Hi
              I tried but get this
              0_1545149326993_ea563488-a731-4134-87bd-9627c9fcfbed-image.png

              The widgets take the same space

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by mrjj
              #6

              @GrahamLa
              Did you set any min/max values on the Tables ?
              It works fine here
              alt text

              You can try the test sample just to be sure it works with your installation
              https://www.dropbox.com/s/kqz2vo8gwbm36j3/layout.zip?dl=0

              1 Reply Last reply
              2
              • G Offline
                G Offline
                GrahamLa
                wrote on last edited by
                #7

                Thats seems to be the problem
                Thanks for your help

                mrjjM 1 Reply Last reply
                0
                • G GrahamLa

                  Thats seems to be the problem
                  Thanks for your help

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @GrahamLa
                  Ok super. if you restrict widget, then layout will obey the limit.
                  please mark as solved if your happy.

                  1 Reply Last reply
                  1

                  • Login

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