Fix crash when closing dialoog with X button
This commit is contained in:
parent
521d3cdaac
commit
2823297482
1 changed files with 3 additions and 4 deletions
|
|
@ -33,17 +33,16 @@ void ConnectionConfigurationWidget::editExistingInWindow(ConnectionController *c
|
|||
auto win = new QDialog;
|
||||
win->setWindowTitle(tr("Edit connection configuration"));
|
||||
win->setLayout(vbox);
|
||||
win->setAttribute( Qt::WA_DeleteOnClose, true );
|
||||
|
||||
win->connect(btn_hbox, &QDialogButtonBox::accepted, [ctrl, w, win] () {
|
||||
auto [grp, cc] = w->data();
|
||||
ctrl->getConnectionTreeModel()->save(grp, cc);
|
||||
win->accept();
|
||||
});
|
||||
win->connect(btn_hbox, &QDialogButtonBox::rejected, [win] () { win->reject(); });
|
||||
|
||||
win->connect(win, &QDialog::finished, [win] (int)
|
||||
win->connect(btn_hbox, &QDialogButtonBox::rejected, [win] ()
|
||||
{
|
||||
delete win;
|
||||
win->reject();
|
||||
});
|
||||
|
||||
win->show();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue