From 5c614efcab51c4be65eb5da4eaf1fb0732470209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 24 Oct 2023 23:03:25 +0200 Subject: [PATCH] QMessageBox: Opt out of native dialog if standard buttons have menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Amends 2d59f2e8caed71d4eceb1abe3ce17b7befb40559, which only checked this for custom buttons, but standard buttons can also be customized. Pick-to: 6.5 Change-Id: Ie8bafcf5007a0b4789b2d0ee1ddbc660a952fee4 Reviewed-by: Richard Moe Gustavsen (cherry picked from commit 7fb0c2bbf9af7956e6b8a0b1906792437aa40517) Reviewed-by: Tor Arne Vestbø --- src/widgets/dialogs/qmessagebox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp index 25de452cfaa..3f3289af3ea 100644 --- a/src/widgets/dialogs/qmessagebox.cpp +++ b/src/widgets/dialogs/qmessagebox.cpp @@ -2818,7 +2818,7 @@ bool QMessageBoxPrivate::canBeNativeDialog() const if (strcmp(QMessageBox::staticMetaObject.className(), q->metaObject()->className()) != 0) return false; - for (auto *customButton : customButtonList) { + for (auto *customButton : buttonBox->buttons()) { if (QPushButton *pushButton = qobject_cast(customButton)) { // We can't support buttons with menus in native dialogs (yet) if (pushButton->menu())