PDA

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



castors33
14th June 2011, 18:19
Hi,


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??

Thanks!!

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

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

castors33
14th June 2011, 22: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...