tags:

views:

71

answers:

2

stack overflow wont let me post images so heres the link:

http://4m0.org/images/qt.png

This is my application. For this question, ignore the top part with the buttons.

I have a QScrollArea

Filled with many QGroupBoxes

Filled with a horizontal box layout of QLabel (on the left) and QGroupBox (on the right)

The right side is a vertical box layout of QPushButtons

Every single element, the scrollarea, both boxes, the labels, and the buttons all have their style sheets modified so padding is 0px and margin is 0px.

Why do i have all this extra space?

The scroll area has space on all sides until its inner elements (the blue boxes) start. Then those boxes have space until its inner elements (the white boxes) start.

Can someone tell me what is going on?

+2  A: 

Why do i have all this extra space?

If I get you right, you need edit your layout code with this, to exclude unneeded spaces:

QVBoxLayout *buttonsLayout = new QVBoxLayout;
buttonsLayout->setContentsMargins(0, 0, 0, 0); // remove spaces
buttonsLayout->setSpacing(0);
buttonsLayout->addWidget(daysButton);
...
mosg
A: 

Catch layout of your QScrollArea

QLayout *layout = myScrollArea->layout(); 
layout->setSpacing(0);
layout->setContentsMargins  ( 0, 0, 0, 0 );
firescreamer