QMessageBox: leave the Option's underlying_type as the default, int

QFlags<Option> will anyway store the value in an `int`, so we gain
nothing from choosing quint8 as the fixed type, except artificially
limiting the number of possible future options to eight.

Found in API-review.

As a drive-by, put options one per line and add a trailing comma where
possible.

Change-Id: I0ed588ea6c7912e50705af89c47e2cf7e2ee23a0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d8952690c75f83388e2b24f1b0f76266a58552e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2023-08-11 22:21:51 +02:00 committed by Qt Cherry-pick Bot
parent b33b0eeb45
commit 3458cf984a
2 changed files with 4 additions and 2 deletions

View File

@ -404,7 +404,9 @@ protected:
public:
// Keep in sync with QMessageBox Option
enum class Option : quint8 { DontUseNativeDialog = 0x00000001 };
enum class Option {
DontUseNativeDialog = 0x00000001,
};
Q_DECLARE_FLAGS(Options, Option);
Q_FLAG(Options);

View File

@ -34,7 +34,7 @@ class Q_WIDGETS_EXPORT QMessageBox : public QDialog
Q_PROPERTY(Options options READ options WRITE setOptions)
public:
// Keep in sync with MessageBoxOption in qplatformdialoghelper.h
enum class Option : quint8 {
enum class Option {
DontUseNativeDialog = 0x00000001
};
Q_FLAG(Option)