PDA

View Full Version : qpushbutton and layout



mickey
11th March 2006, 11:25
Hi I'd like to insert two button in a Hlayout and then try the way to enlarge them to fit entire QWidget where they are...


QPushButton *canc1 = new QPushButton(widget);
QPushButton *canc2 = new QPushButton(widget);
canc1->setText("ok");
canc2->setText("clear");
l = new QHBoxLayout(widget);
l->addWidget(canc1);
l->addWidget(canc2);
In attach the result of this above; Can I enlarge them in vertical using Vlayout? (whithout use setGeometry on button)

jpn
11th March 2006, 14:58
Try setting the vertical size policies of the buttons to:
QSizePolicy::Expanding, QSizePolicy::MinimumExpanding, or maybe even QSizePolicy::Ignored...