Код создания диалога:
QDialog* pDlg = new QDialog(this);
pDlg->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed);
QLabel* pLabel = new QLabel;
QLineEdit* pLineEdit = new QLineEdit;
QHBoxLayout* pHBL1 = new QHBoxLayout();
pHBL1->addWidget(pLabel);
pHBL1->addWidget(pLineEdit);
QPushButton* pButtonCreate = new QPushButton();
pButtonCreate->setText(tr("1"));
QPushButton* pButtonExit = new QPushButton();
pButtonExit->setText(tr("2"));
QHBoxLayout* pHBL2 = new QHBoxLayout();
pHBL2->addWidget(pButtonCreate);
pHBL2->addWidget(pButtonExit);
QVBoxLayout* pVBL = new QVBoxLayout();
pVBL->addLayout(pHBL1);
pVBL->addLayout(pHBL2);
pDlg->setLayout(pVBL);
pDlg->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed);