diff --git a/src/widgets/dialogs/qmessagebox.h b/src/widgets/dialogs/qmessagebox.h index 3498fb29c94..45e7a47cb85 100644 --- a/src/widgets/dialogs/qmessagebox.h +++ b/src/widgets/dialogs/qmessagebox.h @@ -6,6 +6,7 @@ #include #include +#include QT_REQUIRE_CONFIG(messagebox); @@ -64,6 +65,10 @@ public: NRoles }; + Q_ENUM(ButtonRole) + static_assert(static_cast(ButtonRole::NRoles) == + static_cast(QDialogButtonBox::ButtonRole::NRoles), + "QMessageBox::ButtonRole and QDialogButtonBox::ButtonRole out of sync!"); enum StandardButton { // keep this in sync with QDialogButtonBox::StandardButton and QPlatformDialogHelper::StandardButton @@ -98,6 +103,12 @@ public: FlagMask = 0x00000300, // obsolete ButtonMask = ~FlagMask // obsolete }; + Q_ENUM(StandardButton); + static_assert(static_cast(StandardButton::LastButton) == + static_cast(QDialogButtonBox::StandardButton::LastButton), + "QMessageBox::StandardButton and QDialogButtonBox::StandardButton out of sync!"); + + #if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) typedef StandardButton Button; #endif