Bug 484251 - Dismissing KMessageDialog via Esc key emits QDialog::finished twice
Summary: Dismissing KMessageDialog via Esc key emits QDialog::finished twice
Status: REPORTED
Alias: None
Product: frameworks-kwidgetsaddons
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 6.0.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Christoph Feck
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-22 14:44 UTC by Nicolas Fella
Modified: 2024-03-22 14:44 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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