Relative Content

Tag Archive for c++qtlayoutqscrollarea

Reduce size of QScrollArea to a minimum

Below is a massively stripped down code of an application I have. The application uses different QGroupBoxes for data display. The lowest QGroupBox has a QScrollArea which contains a changing (and sometimes large) number of labels. Thus I need a scrolling area. Code works, but wastes a lot of space above and below the labels. In my case 113 pixel of which about 30 below and 30 above are wasted. I’d like to get rid of them but can’t find a way. Using the size policy and the zero margins already helped a bit, but it’s still not enough. I experimented with many more size policies and margins at different components, but nothing helps.