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

Grid layout column width

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 2.6k 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.
  • M Offline
    M Offline
    MartynWheeler
    wrote on last edited by
    #1

    Hi,

    I have just started using qt creator and I am very impressed so far. I have managed to do in a couple of hours what took me more than a day with wxwidgets.

    I am trying to apply a layout to my form. I have a group of controls in grid and then a tab control. I would like the group of controls to have a fixed width and height but the tab control to grow and shrink with the form


    | | |
    | | |
    | controls | tabs |
    | | |
    | | |
    | | |

    However, when I apply a grid layout to the form it always puts the two parts in columns with the same size in the designer. Is there a way to have individually sized columns in the designer?

    Sorry is it a really obvious question,

    Thanks in advance,

    Martyn

    Pl45m4P 1 Reply Last reply
    0
    • M MartynWheeler

      Hi,

      I have just started using qt creator and I am very impressed so far. I have managed to do in a couple of hours what took me more than a day with wxwidgets.

      I am trying to apply a layout to my form. I have a group of controls in grid and then a tab control. I would like the group of controls to have a fixed width and height but the tab control to grow and shrink with the form


      | | |
      | | |
      | controls | tabs |
      | | |
      | | |
      | | |

      However, when I apply a grid layout to the form it always puts the two parts in columns with the same size in the designer. Is there a way to have individually sized columns in the designer?

      Sorry is it a really obvious question,

      Thanks in advance,

      Martyn

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @MartynWheeler said in Grid layout column width:

      Is there a way to have individually sized columns in the designer?

      The layout takes care of your widget according to your layout and size policies.
      But you can set a stretch factor. This will in- or decrease the size proportional to your other elements (e.g. twice as big).
      For example you can divide the layout into e.g. 9 parts and let one widget take 2/9, one 6/9, and one 1/9

      • https://doc.qt.io/qt-5/layout.html#stretch-factors

      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      2
      • M Offline
        M Offline
        MartynWheeler
        wrote on last edited by
        #3

        Thanks, that has fixed the issue

        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