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;
|
auto win = new QDialog;
|
||||||
win->setWindowTitle(tr("Edit connection configuration"));
|
win->setWindowTitle(tr("Edit connection configuration"));
|
||||||
win->setLayout(vbox);
|
win->setLayout(vbox);
|
||||||
|
win->setAttribute( Qt::WA_DeleteOnClose, true );
|
||||||
|
|
||||||
win->connect(btn_hbox, &QDialogButtonBox::accepted, [ctrl, w, win] () {
|
win->connect(btn_hbox, &QDialogButtonBox::accepted, [ctrl, w, win] () {
|
||||||
auto [grp, cc] = w->data();
|
auto [grp, cc] = w->data();
|
||||||
ctrl->getConnectionTreeModel()->save(grp, cc);
|
ctrl->getConnectionTreeModel()->save(grp, cc);
|
||||||
win->accept();
|
win->accept();
|
||||||
});
|
});
|
||||||
win->connect(btn_hbox, &QDialogButtonBox::rejected, [win] () { win->reject(); });
|
win->connect(btn_hbox, &QDialogButtonBox::rejected, [win] ()
|
||||||
|
|
||||||
win->connect(win, &QDialog::finished, [win] (int)
|
|
||||||
{
|
{
|
||||||
delete win;
|
win->reject();
|
||||||
});
|
});
|
||||||
|
|
||||||
win->show();
|
win->show();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue