Code wise using:
QGroupBox *groupBox = new QGroupBox(tr("My Group Box"));
QGridLayout *layout = new QGridLayout(groupBox);
layout->addWidget(new QPushButton(tr("My Nice Button")), 0, 0);
layout->setColumnStretch(0, 1);
layout->setColumnStretch(1, 1);
does what you want.