macOS: Include StandardButton::RestoreDefaults when adding native alert buttons

The loop was breaking one button too early.

Pick-to: 6.5
Change-Id: Ic5027a2e4e35fbd54bf25b310768fd3278d4874b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit cd3a409589f139c693f4125bb9f276aa16842609)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tor Arne Vestbø 2023-10-24 16:13:59 +02:00 committed by Qt Cherry-pick Bot
parent 44902f09cf
commit 8bb6941738

View File

@ -170,7 +170,7 @@ bool QCocoaMessageDialog::show(Qt::WindowFlags windowFlags, Qt::WindowModality w
const auto *platformTheme = QGuiApplicationPrivate::platformTheme();
if (auto standardButtons = options()->standardButtons()) {
for (int standardButton = FirstButton; standardButton < LastButton; standardButton <<= 1) {
for (int standardButton = FirstButton; standardButton <= LastButton; standardButton <<= 1) {
if (standardButtons & standardButton) {
auto title = platformTheme->standardButtonText(standardButton);
addButton(title, standardButton, buttonRole(StandardButton(standardButton)));