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. Problem using layouts ion QT Designer
QtWS25 Last Chance

Problem using layouts ion QT Designer

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 346 Views
  • 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.
  • A Offline
    A Offline
    Achab61
    wrote on last edited by
    #1

    I'm trying to design a QWidget form using layouts and I have the following issue:
    my need is to nest a Grid Layout and a Vertical Layout into a Horizontal layout. I put the Horizontal Layout in the form but when I insert the Grid layout (into Horizontal layout) it takes the whole size of Horizontal layout and I can't resize the Grid layout only.
    I checked the documentation but I didn't find a solution for this behaviour.

    Thanks for any suggestion

    jsulmJ 1 Reply Last reply
    0
    • A Achab61

      I'm trying to design a QWidget form using layouts and I have the following issue:
      my need is to nest a Grid Layout and a Vertical Layout into a Horizontal layout. I put the Horizontal Layout in the form but when I insert the Grid layout (into Horizontal layout) it takes the whole size of Horizontal layout and I can't resize the Grid layout only.
      I checked the documentation but I didn't find a solution for this behaviour.

      Thanks for any suggestion

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Achab61 said in Problem using layouts ion QT Designer:

      it takes the whole size of Horizontal layout and I can't resize the Grid layout only

      Of course it does if there is noting else in the horizontal layout.
      What exactly do you want to achieve? How big should the grid layout be?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Achab61
        wrote on last edited by
        #3

        My need is to have a Horizontal layout containing a Grid layout and a Vertical layout. The Grid layout should take more than half size of the Horizontal and the rest should be for the Vertical. I will then put label and text box in the Grid and button and check box in the Vertical.
        I first placed the Horizontal layout in the form, then I drag the Grid but, as said, it takes the whole size and it can't be resized.

        jsulmJ 1 Reply Last reply
        0
        • A Achab61

          My need is to have a Horizontal layout containing a Grid layout and a Vertical layout. The Grid layout should take more than half size of the Horizontal and the rest should be for the Vertical. I will then put label and text box in the Grid and button and check box in the Vertical.
          I first placed the Horizontal layout in the form, then I drag the Grid but, as said, it takes the whole size and it can't be resized.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Achab61 said in Problem using layouts ion QT Designer:

          it takes the whole size and it can't be resized

          No need to resize it. Add the vertical layout to the horizontal (next to grid layout). It can be somewhat tricky, but works. Then select the horizontal layout and set the layoutStretch property to your needs, so the horizontal layout reserves different amount of space for grid and vertical layout.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          2
          • A Offline
            A Offline
            Achab61
            wrote on last edited by
            #5

            I got it. Thanks a lot.

            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