diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp index bb71a2370e4..5d0c84e9d49 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(); }