Commit 93d54a0b authored by Laurent Montel's avatar Laurent Montel 😁

Add parent

parent 8956123d
......@@ -45,13 +45,12 @@ MigrationAgent::MigrationAgent(const QString &id)
void MigrationAgent::configure(WId windowId)
{
QDialog *dlg = new QDialog();
QVBoxLayout *topLayout = new QVBoxLayout;
dlg->setLayout(topLayout);
QVBoxLayout *topLayout = new QVBoxLayout(dlg);
MigrationStatusWidget *widget = new MigrationStatusWidget(mScheduler, dlg);
topLayout->addWidget(widget);
dlg->setAttribute(Qt::WA_DeleteOnClose);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, dlg);
connect(buttonBox, &QDialogButtonBox::accepted, dlg, &QDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, dlg, &QDialog::reject);
topLayout->addWidget(buttonBox);
......
......@@ -95,11 +95,11 @@ void MigrationStatusWidget::abortSelected()
void MigrationStatusWidget::onItemActivated(const QModelIndex &index)
{
QDialog *dlg = new QDialog(this);
QVBoxLayout *topLayout = new QVBoxLayout;
QVBoxLayout *topLayout = new QVBoxLayout(dlg);
dlg->setLayout(topLayout);
QWidget *widget = new QWidget(dlg);
topLayout->addWidget(widget);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, dlg);
connect(buttonBox, &QDialogButtonBox::accepted, dlg, &QDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, dlg, &QDialog::reject);
topLayout->addWidget(buttonBox);
......
......@@ -478,8 +478,7 @@ QString Settings::promptForPassword(const QString &user)
QString password;
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Help);
QVBoxLayout *mainLayout = new QVBoxLayout;
dlg->setLayout(mainLayout);
QVBoxLayout *mainLayout = new QVBoxLayout(dlg);
QPushButton *okButton = buttonBox->button(QDialogButtonBox::Ok);
okButton->setDefault(true);
okButton->setShortcut(Qt::CTRL | Qt::Key_Return);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment