Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.5.5, 6.6.2
-
None
-
-
641e5cb4b (6.6), e9838d715 (tqtc/lts-6.5)
Description
In Qt 6.6.2, the MessageDialog accepted signal isn’t emitted for the Ok button:
MessageDialog { text: "Really?" buttons: MessageDialog.Ok | MessageDialog.Cancel onAccepted: console.log("Accepted") onRejected: console.log("Rejected") onButtonClicked: (button, role) => { console.log("Button", button, "Role", role); } }
Using Universal style and the QML dialog implementation.
Clicking the Ok button prints
qml: Button 1024 Role 0 qml: Rejected
Button 1024 is OkButton and 0 is AcceptedRole, so the correct button is detected but the dialog isn’t accepted.
It feels like the close() call that was added causes the dialog to be rejected? https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=b00798df9d842570524550b6780a1debc4fe5387
This worked in Qt 6.6.1
Attachments
For Gerrit Dashboard: QTBUG-122770 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
546469,5 | MessageDialog: emit accepted, for buttons with roles Yes and Accept | 6.6 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
547836,2 | MessageDialog: emit accepted, for buttons with roles Yes and Accept | tqtc/lts-6.5 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |