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

Problem using layouts ion QT Designer

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 417 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 26 Jan 2022, 13:31 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

    J 1 Reply Last reply 26 Jan 2022, 13:34
    0
    • A Achab61
      26 Jan 2022, 13:31

      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

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 26 Jan 2022, 13:34 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 26 Jan 2022, 14:00 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.

        J 1 Reply Last reply 26 Jan 2022, 14:13
        0
        • A Achab61
          26 Jan 2022, 14:00

          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.

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 26 Jan 2022, 14:13 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 26 Jan 2022, 14:16 last edited by
            #5

            I got it. Thanks a lot.

            1 Reply Last reply
            0

            1/5

            26 Jan 2022, 13:31

            • 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