Fix build with -no-feature-menu

Change-Id: If207eac9a237986d51de4665b2f6749fb4e8e2d2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Tasuku Suzuki 2023-11-15 11:59:40 +09:00
parent d5dbafca1f
commit 92a9df5d05

View File

@ -2817,6 +2817,7 @@ bool QMessageBoxPrivate::canBeNativeDialog() const
if (strcmp(QMessageBox::staticMetaObject.className(), q->metaObject()->className()) != 0)
return false;
#if QT_CONFIG(menu)
for (auto *customButton : buttonBox->buttons()) {
if (QPushButton *pushButton = qobject_cast<QPushButton *>(customButton)) {
// We can't support buttons with menus in native dialogs (yet)
@ -2824,6 +2825,7 @@ bool QMessageBoxPrivate::canBeNativeDialog() const
return false;
}
}
#endif
return QDialogPrivate::canBeNativeDialog();
}