PDA

View Full Version : QGroupBox size problem



MarkoSan
22nd November 2009, 17:17
Hi to all!

I've been having problems with layouts for quite some time, I've read the docs and some book but I still do not get it :o. I have QWidget with HBoxLayout for some pushbuttons and then vertical main layout with this pushbutton layout and under it there is QGroupBox. Now, how do I resize layout to full size of coresponding widget so the buttons and QGroupBox would be larger? Sorry for new question, but I am losing my mind ... If I harcode size with QGroupBox::setFixedSize, then it works, but this is NOT what I want ...

Sincerely,
Marko

franz
22nd November 2009, 18:28
QWidget *parent = new QWidget(this);
QHBoxLayout *layout = new QHBoxLayout;
parent->setLayout(layout);

This binds the size of the layout to it's containing widget. Is that what you need?

MarkoSan
22nd November 2009, 18:44
QWidget *parent = new QWidget(this);
QHBoxLayout *layout = new QHBoxLayout;
parent->setLayout(layout);This binds the size of the layout to it's containing widget. Is that what you need?

:D:D. I forgot to create main layout for parent window! :D:D What a stupido! Thanks for guideline!