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. How do I add a Lay Out Horizontally in Splitter inside a layout that's the same size as the widget?
Forum Updated to NodeBB v4.3 + New Features

How do I add a Lay Out Horizontally in Splitter inside a layout that's the same size as the widget?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 2.4k 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.
  • johnratiusJ Offline
    johnratiusJ Offline
    johnratius
    wrote on last edited by
    #1

    I have been messing with Qt Designer for some time and I can't figure out how to add a splitter lay out inside my current layout that's the same size as the widget. Here is an image that better clarifies what I'm trying to do.

    image of qt designer

    With the two widgets selected in the picture, I right click and go to Lay out, but all the options are greyed out. I tried adding different widgets, like containers or other layouts to see if they would work but they did not.

    I want to be able to have my entire gui resize with the window but can't figure out how to get a splitter pane to do that.
    Any recommendations?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      Bonnie
      wrote on last edited by Bonnie
      #4

      The widgets cannot be added to a splitter if they are already added to a layout.
      So you still need to break the grid layout of centeralWidget.

      1 Reply Last reply
      3
      • Gojir4G Offline
        Gojir4G Offline
        Gojir4
        wrote on last edited by
        #2

        @johnratius said in How do I add a Lay Out Horizontally in Splitter inside a layout that's the same size as the widget?:

        I want to be able to have my entire gui resize with the window

        A layout should already achieve that.

        Is it the formLayout who do not resize ? That's probably because scrollArea take all the place by default. But you can change this behavior using layout stretch factors and/or widget size policies

        If you really need a splitter, I think the items you have selected (scrollArea, verticalLayout) are already in the layout horizontalLayout so this could be why you cannot put them in a splitter. You probably need to break horizontalLayout and replace it by a splitter from Qt Designer

        1 Reply Last reply
        0
        • johnratiusJ Offline
          johnratiusJ Offline
          johnratius
          wrote on last edited by johnratius
          #3

          @Gojir4 Currently the horizontalLayout layout does resize to the window. That's the first step done, but now I can't put two widgets inside the horizontal layout into a splitter layout. The options are greyed out.

          I tried breaking the horizontal layout to put the child widgets into a splitter layout but the options are still greyed out. Any ideas why? Am I not allowed to create a splitter layout with "window-sized" layout?

          Edit:
          I changed my layout to be a bit more simpler for now.
          alt text

          I sill don't have access to the splitter layouts even when I have groupboxes. I tried this when they did not have grid layout and with the grid layout. Nothing.

          If this changes anything, I am using Qt Designer, not the one inside Qt Creator. (I'm using VS + Qt Designer)

          1 Reply Last reply
          0
          • B Offline
            B Offline
            Bonnie
            wrote on last edited by Bonnie
            #4

            The widgets cannot be added to a splitter if they are already added to a layout.
            So you still need to break the grid layout of centeralWidget.

            1 Reply Last reply
            3
            • johnratiusJ Offline
              johnratiusJ Offline
              johnratius
              wrote on last edited by
              #5

              @Bonnie I see. I got it to work now. Thanks.

              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