Commit b00798d
Oliver Eftevaag
MessageDialog: Dont rely on accept or reject signal emissions from QPA
Currently, all native dialog implementations need to emit the
QPlatformDialogHelper::accept and QPlatformDialogHelper::reject signals,
in order for the QQuickAbstractDialog to be able to react to changes and
update its visibility property.
This makes sense for most dialogs, that have 2 buttons ("Ok" and "Cancel").
The MessageDialog however, is more complicated in that it can have an
arbitrary number of buttons. To further complicate things, it can also
have buttons with other roles than simply YesRole|AcceptRole|NoRole|RejectRole.
Because of this, the native message dialogs will sometimes only emit
QPlatformMessageDialogHelper::clicked, which makes QQuickMessageDialog
responsible for figuring out what to do next.
This patch fixes the issue by calling close() in handleClick().
This is safe to do, since currently all of our native message dialog
implementations close after any button is pressed.
It is very important that the QQuickAbstractDialog and native dialog are
in agreement as to whether a dialog is currently open or not. In cases
where there is a mismatch, a new dialog will never be able to be opened
again, since QQuickAbstractDialog will return early when the user
attempt to open a dialog that it believes is already showing.
[ChangeLog][QtQuick][Dialogs] The MessageDialog will now close when a
button is pressed, regardless of the button's role.
Pick-to: 6.6 6.5
Task-number: QTBUG-118689
Fixes: QTBUG-118445
Fixes: QTBUG-118212
Change-Id: I67a7c575fe5ce8a595eb71cf7056a1d8709ff50d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>1 parent 33299c2 commit b00798d
1 file changed
+1
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| 222 | + | |
222 | 223 | | |
223 | 224 | | |
224 | 225 | | |
| |||
0 commit comments