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. QtCreator - resizing elements inside a layout
Forum Update on Monday, May 27th 2025

QtCreator - resizing elements inside a layout

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 4.2k 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.
  • S Offline
    S Offline
    szczurcio
    wrote on last edited by
    #1

    Hello,
    I'd like to add a simple "About" box to my application. I want it to contain a few lines (centered) and an OK button.

    I've aligned all these elements in a Vertical Layout, but now I'm unable to resize individual elements inside it(for example, the OK button which is stretched to the width of the window). When I select an element, I get a bright blue frame which I'm unable to resize, as opposed to the resizable dark blue which normally appears.

    What am I missing?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2

      Add horizontal spacers around the button in the layout.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        szczurcio
        wrote on last edited by
        #3

        [quote author="andreyc" date="1407956315"]Add horizontal spacers around the button in the layout.
        [/quote]

        Unfortunately, I can't. When I drag and drop one, it's added in a new line, stretched to full width, and similarly to the other elements I can't resize it.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andreyc
          wrote on last edited by
          #4

          Try this

          1. Break current layouts.
          2. Add horizontal spacer at left and right of the button
          3. Select the button and the spacers and create a horizontal layout.
          4. Deselect everything in a widget and create a vertical layout for the widget.
          1 Reply Last reply
          0
          • S Offline
            S Offline
            szczurcio
            wrote on last edited by
            #5

            I guess that helped. 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