From fffc8714ec97aad85045d225ebb06ddb00191dff Mon Sep 17 00:00:00 2001 From: Takahiro Yoshizawa Date: Tue, 25 Nov 2025 20:54:00 +0900 Subject: [PATCH] Refactor: Replace QDialog::exec() with QDialog::open() in SkkDictWidget::addDictClicked() --- gui/dictwidget.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gui/dictwidget.cpp b/gui/dictwidget.cpp index e26cf9b..945a2e4 100644 --- a/gui/dictwidget.cpp +++ b/gui/dictwidget.cpp @@ -65,12 +65,15 @@ void SkkDictWidget::save() { } void SkkDictWidget::addDictClicked() { - AddDictDialog dialog; - int result = dialog.exec(); - if (result == QDialog::Accepted) { - m_dictModel->add(dialog.dictionary()); + AddDictDialog *dialog = new AddDictDialog(this); + dialog->setAttribute(Qt::WA_DeleteOnClose); + + connect(dialog, &QDialog::accepted, this, [this, dialog]() { + m_dictModel->add(dialog->dictionary()); Q_EMIT changed(true); - } + }); + + dialog->open(); } void SkkDictWidget::defaultDictClicked() {