diff options
| author | Oliver Eftevaag <oliver.eftevaag@qt.io> | 2023-11-03 17:00:57 +0100 |
|---|---|---|
| committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-12-09 17:37:15 +0000 |
| commit | ec8564963eaa97fc113cb5334784ecadc93d0ffd (patch) | |
| tree | 627b85ab3b4c92ab73d51fdc2b0f4e09792e6b54 /src/quicktestutils/qml/testhttpserver.cpp | |
| parent | e1afd77ed579dbe8f26829f24e68e61867cd81ab (diff) | |
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.
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>
(cherry picked from commit b00798df9d842570524550b6780a1debc4fe5387)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 18fc3862d057763d6faf44233d0285c662fe014a)
Diffstat (limited to 'src/quicktestutils/qml/testhttpserver.cpp')
0 files changed, 0 insertions, 0 deletions
