Пример:
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QWidget* w = new QWidget;
QVBoxLayout* l = new QVBoxLayout;
w->setLayout(l);
QPushButton* b = new QPushButton("hello");
b->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
l->addWidget(b);
w->show();
return app.exec();
}