Editor: only remove one scheme at a time

Since the delete button has already the accept role the delete was
triggered twice. First time by the role and second time from the connect
of the button clicked signal to QDialog::accept.

Change-Id: I9bd6104d36f286ec8bd0b25ee4ab6e7c8306d51a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2021-07-01 10:55:24 +02:00
parent 8bef120f14
commit 18b98a85eb

View File

@@ -508,7 +508,6 @@ void FontSettingsPageWidget::confirmDeleteColorScheme()
messageBox->addButton(deleteButton, QMessageBox::AcceptRole); messageBox->addButton(deleteButton, QMessageBox::AcceptRole);
messageBox->setDefaultButton(deleteButton); messageBox->setDefaultButton(deleteButton);
connect(deleteButton, &QAbstractButton::clicked, messageBox, &QDialog::accept);
connect(messageBox, &QDialog::accepted, this, &FontSettingsPageWidget::deleteColorScheme); connect(messageBox, &QDialog::accepted, this, &FontSettingsPageWidget::deleteColorScheme);
messageBox->setAttribute(Qt::WA_DeleteOnClose); messageBox->setAttribute(Qt::WA_DeleteOnClose);
messageBox->open(); messageBox->open();