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

The loop was breaking one button too early.

Pick-to: 6.5 6.6
Change-Id: Ic5027a2e4e35fbd54bf25b310768fd3278d4874b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Tor Arne Vestbø 2023-10-24 16:13:59 +02:00
parent 4a16e51bc3
commit cd3a409589

View File

@ -177,7 +177,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)));