Bug 484251

Summary: Dismissing KMessageDialog via Esc key emits QDialog::finished twice
Product: [Frameworks and Libraries] frameworks-kwidgetsaddons Reporter: Nicolas Fella <nicolas.fella>
Component: generalAssignee: Christoph Feck <cfeck>
Status: REPORTED ---    
Severity: normal CC: kdelibs-bugs-null
Priority: NOR    
Version First Reported In: 6.0.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Nicolas Fella 2024-03-22 14:44:39 UTC
Running

KMessageDialog *dialog = new KMessageDialog(KMessageDialog::WarningTwoActionsCancel, QStringLiteral("Hello"));
QObject::connect(dialog, &QDialog::finished, [](int result){
    qWarning() << "res" << result;
});
dialog->show();

and then pressing Esc to close the dialog will print twice. One time with result QDialogButtonBox::Cancel, another time with 0.

This does not happen when clicking the cancel button


SOFTWARE/OS VERSIONS
KDE Plasma Version: 6.0
KDE Frameworks Version: 6.0 
Qt Version: 6.7

ADDITIONAL INFORMATION