diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp index 596bc9968ae..5d5ba6e117d 100644 --- a/src/widgets/dialogs/qmessagebox.cpp +++ b/src/widgets/dialogs/qmessagebox.cpp @@ -2824,6 +2824,14 @@ bool QMessageBoxPrivate::canBeNativeDialog() const if (strcmp(QMessageBox::staticMetaObject.className(), q->metaObject()->className()) != 0) return false; + for (auto *customButton : customButtonList) { + if (QPushButton *pushButton = qobject_cast(customButton)) { + // We can't support buttons with menus in native dialogs (yet) + if (pushButton->menu()) + return false; + } + } + return QDialogPrivate::canBeNativeDialog(); }