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
Forum Updated to NodeBB v4.3 + New Features

Layout problems

Scheduled Pinned Locked Moved Solved General and Desktop
qt5.5qgridlayout
8 Posts 2 Posters 1.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 18 Dec 2018, 15:20 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
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 18 Dec 2018, 15:33 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 18 Dec 2018, 15:57 last edited by
        #3

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

        M 1 Reply Last reply 18 Dec 2018, 16:01
        0
        • G GrahamLa
          18 Dec 2018, 15:57

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

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 18 Dec 2018, 16:01 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 18 Dec 2018, 16:09 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

            M 1 Reply Last reply 18 Dec 2018, 16:12
            1
            • G GrahamLa
              18 Dec 2018, 16:09

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

              The widgets take the same space

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 18 Dec 2018, 16:12 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 18 Dec 2018, 16:18 last edited by
                #7

                Thats seems to be the problem
                Thanks for your help

                M 1 Reply Last reply 18 Dec 2018, 16:21
                0
                • G GrahamLa
                  18 Dec 2018, 16:18

                  Thats seems to be the problem
                  Thanks for your help

                  M Offline
                  M Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 18 Dec 2018, 16:21 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

                  1/8

                  18 Dec 2018, 15:20

                  • Login

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