diff options
| author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2023-06-28 15:52:09 +0200 |
|---|---|---|
| committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2023-06-29 18:49:46 +0200 |
| commit | 4a4283e3e98d779e6eb6cb47d408fe4fd402cdf8 (patch) | |
| tree | 5ce3a4287612862c735d805e029b907b3cbf11ad /src/testlib/doc/snippets/code | |
| parent | 6da1ecc8c2b9f7fd488194b6e81b41a314b678d5 (diff) | |
QMessageBox: Plumb native button clicks back to dialog's QAbstractButton
The native dialog helper is populated with buttons based on the message
box buttons, which are still represented as QAbstractButtons, either
by adding custom buttons, or by turning QMessageBox::StandardButton
into QAbstractButton.
To ensure as little difference as possible between the native and
non-native backed dialogs, we plumb the dialog helper clicks back
to the corresponding QAbstractButton. We were already doing this
partially for custom dialog buttons, but now we also do it for
standard buttons.
As the click() will plumb back to _q_buttonClicked, which calls
setClickedButton to finalize the dialog, we don't need to do
this explicitly anymore.
For custom buttons it now means the result() of the message box
will be the custom button's index, not its role, but the result
in this case is documented to be an opaque value, and it's best
to keep these the same for native and non-native dialogs.
Pick-to: 6.5 6.6
Change-Id: I5fe3b28e4c4ed879775610103cd1b591b3353f7e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/testlib/doc/snippets/code')
0 files changed, 0 insertions, 0 deletions
