View Full Version : Spacing in a dock that contains 7 buttons [resolved]

14th June 2011, 19:19

I have a dock that contains 7 QPushButton, I want them to be a little more near the top. So, I'm trying to put a spacer with the simple fonction layout.addSpacing(30) to "push" the buttons up, whatever the real number. But, it puts space under AND above...I can have space only on the top, but not the bottom...

Any tip??


14th June 2011, 20:04
I would recommend that you implement this using QT Designer, instead of manually coding the layout.

14th June 2011, 21:22
Use QBoxLayout::addStretch().

14th June 2011, 23:05
thanks for both answers!
I tried with Qt Designer and it helped me thanks. I had already tried addStretch but it didn't work either....that was a problem with my sizePolicy...