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. QVBoxLayout - no stretch/expanding
Forum Update on Monday, May 27th 2025

QVBoxLayout - no stretch/expanding

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

    Hi,

    I have a QScrollArea with a QBoxLayout. At runtime I insert widgets into the scroll area using insertWidget(0,widget). I want the widgets to be listed directly below each other, but instead they are centered with space around them. How can I change that?

    Thanks for any hints,

    Best regards,

    Eddy

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

      The space around them is controlled by the spacing parameter of the layout. Change that property in your layout to 0.

      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