Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.
Adjust Spacing and Margins between Widgets in Layout
Jump to navigation
Jump to search
Adjust Spacing and Margins between Widgets in Layout
Overview
To adjust margins and spacing between widgets [qt.io] use the following methods setSpacing() [qt.io] and setContentsMargins() [qt.io] that are implemented in class QLayout [qt.io].
Example
This code snippet shows how to remove spacing and margins between widgets in instance of QVBoxLayout [qt.io]