From 23beda3c2868f3d23560c4dadc6f0a9703475d40 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Mon, 9 Dec 2024 15:39:06 +0100 Subject: [PATCH] more enum types specified --- src/controls/QskGesture.h | 4 ++-- src/controls/QskGestureRecognizer.h | 2 +- src/controls/QskGraphicLabel.h | 2 +- src/controls/QskListView.h | 2 +- src/controls/QskPopup.h | 2 +- src/controls/QskProgressRing.h | 2 +- src/controls/QskPushButton.h | 2 +- src/controls/QskSkin.h | 2 +- src/controls/QskSkinTransition.h | 2 +- src/controls/QskSkinnable.h | 2 +- src/controls/QskSpinBox.h | 2 +- src/controls/QskSubWindow.h | 2 +- src/controls/QskSwitchButton.h | 2 +- src/controls/QskTextField.h | 4 ++-- src/controls/QskWindow.h | 2 +- src/dialogs/QskDialog.h | 10 +++++----- src/dialogs/QskDialogButtonBox.cpp | 2 +- src/graphic/QskGraphic.h | 6 +++--- src/graphic/QskPainterCommand.h | 2 +- src/graphic/QskStandardSymbol.h | 2 +- src/layouts/QskLayoutChain.h | 2 +- src/layouts/QskLayoutEngine2D.h | 2 +- src/nodes/QskFillNode.h | 6 +++--- src/nodes/QskGraduationNode.h | 2 +- src/nodes/QskGraduationRenderer.h | 2 +- src/nodes/QskPaintedNode.h | 2 +- 26 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/controls/QskGesture.h b/src/controls/QskGesture.h index 847f6200..cc2849ec 100644 --- a/src/controls/QskGesture.h +++ b/src/controls/QskGesture.h @@ -16,7 +16,7 @@ class QSK_EXPORT QskGesture Q_GADGET public: - enum Type + enum Type : qint16 { NoType = -1, @@ -33,7 +33,7 @@ class QSK_EXPORT QskGesture }; Q_ENUM( Type ) - enum State + enum State : quint8 { NoGesture, diff --git a/src/controls/QskGestureRecognizer.h b/src/controls/QskGestureRecognizer.h index 38c1ca96..91000ac0 100644 --- a/src/controls/QskGestureRecognizer.h +++ b/src/controls/QskGestureRecognizer.h @@ -32,7 +32,7 @@ class QSK_EXPORT QskGestureRecognizer : public QObject using Inherited = QObject; public: - enum State + enum State : quint8 { Idle, Pending, diff --git a/src/controls/QskGraphicLabel.h b/src/controls/QskGraphicLabel.h index f79ecf39..56ccdffe 100644 --- a/src/controls/QskGraphicLabel.h +++ b/src/controls/QskGraphicLabel.h @@ -40,7 +40,7 @@ class QSK_EXPORT QskGraphicLabel : public QskControl public: QSK_SUBCONTROLS( Panel, Graphic ) - enum FillMode + enum FillMode : quint8 { Stretch, PreserveAspectFit, diff --git a/src/controls/QskListView.h b/src/controls/QskListView.h index 4dc15a11..42983f0b 100644 --- a/src/controls/QskListView.h +++ b/src/controls/QskListView.h @@ -32,7 +32,7 @@ class QSK_EXPORT QskListView : public QskScrollView QSK_SUBCONTROLS( Cell, Text, Graphic ) QSK_STATES( Selected ) - enum SelectionMode + enum SelectionMode : quint8 { NoSelection, SingleSelection, diff --git a/src/controls/QskPopup.h b/src/controls/QskPopup.h index 94feb773..60efee4a 100644 --- a/src/controls/QskPopup.h +++ b/src/controls/QskPopup.h @@ -27,7 +27,7 @@ class QSK_EXPORT QskPopup : public QskControl QSK_SUBCONTROLS( Overlay ) QSK_STATES( Closed ) - enum PopupFlag + enum PopupFlag : quint8 { DeleteOnClose = 1 << 0, CloseOnPressOutside = 1 << 1 diff --git a/src/controls/QskProgressRing.h b/src/controls/QskProgressRing.h index 90d0048c..4123434f 100644 --- a/src/controls/QskProgressRing.h +++ b/src/controls/QskProgressRing.h @@ -20,7 +20,7 @@ class QSK_EXPORT QskProgressRing : public QskProgressIndicator public: QSK_SUBCONTROLS( Groove, Fill ) - enum Size + enum Size : qint8 { SmallSize = -1, NormalSize = 0, diff --git a/src/controls/QskPushButton.h b/src/controls/QskPushButton.h index 93515034..12b99040 100644 --- a/src/controls/QskPushButton.h +++ b/src/controls/QskPushButton.h @@ -47,7 +47,7 @@ class QSK_EXPORT QskPushButton : public QskAbstractButton public: QSK_SUBCONTROLS( Panel, Splash, Text, Icon ) - enum Emphasis + enum Emphasis : qint8 { VeryLowEmphasis = -2, LowEmphasis = -1, diff --git a/src/controls/QskSkin.h b/src/controls/QskSkin.h index 1a3012c3..dff77874 100644 --- a/src/controls/QskSkin.h +++ b/src/controls/QskSkin.h @@ -36,7 +36,7 @@ class QSK_EXPORT QskSkin : public QObject public: #if 1 // Use Qt::ColorScheme once minimum version is Qt 6.5 - enum ColorScheme + enum ColorScheme : quint8 { UnknownScheme, diff --git a/src/controls/QskSkinTransition.h b/src/controls/QskSkinTransition.h index fad3dd38..badbd5bb 100644 --- a/src/controls/QskSkinTransition.h +++ b/src/controls/QskSkinTransition.h @@ -22,7 +22,7 @@ template< typename Key, typename T > class QHash; class QSK_EXPORT QskSkinTransition { public: - enum Type + enum Type : quint8 { Color = 1, Metric = 2, diff --git a/src/controls/QskSkinnable.h b/src/controls/QskSkinnable.h index 08488ee0..a4772448 100644 --- a/src/controls/QskSkinnable.h +++ b/src/controls/QskSkinnable.h @@ -46,7 +46,7 @@ class QskSkinStateChanger; class QSK_EXPORT QskSkinHintStatus { public: - enum Source + enum Source : quint8 { NoSource = 0, diff --git a/src/controls/QskSpinBox.h b/src/controls/QskSpinBox.h index 4083f9e6..7e62a26b 100644 --- a/src/controls/QskSpinBox.h +++ b/src/controls/QskSpinBox.h @@ -25,7 +25,7 @@ class QSK_EXPORT QskSpinBox : public QskBoundedValueInput QSK_STATES( Decreasing, Increasing ) - enum Decoration + enum Decoration : quint8 { NoDecoration, diff --git a/src/controls/QskSubWindow.h b/src/controls/QskSubWindow.h index e3f0b949..f8ed3fc9 100644 --- a/src/controls/QskSubWindow.h +++ b/src/controls/QskSubWindow.h @@ -34,7 +34,7 @@ class QSK_EXPORT QskSubWindow : public QskPopup using Inherited = QskPopup; public: - enum Decoration + enum Decoration : quint16 { NoDecoration = 0, diff --git a/src/controls/QskSwitchButton.h b/src/controls/QskSwitchButton.h index e12cc65f..fa2c1a61 100644 --- a/src/controls/QskSwitchButton.h +++ b/src/controls/QskSwitchButton.h @@ -27,7 +27,7 @@ class QSK_EXPORT QskSwitchButton : public QskAbstractButton public: QSK_SUBCONTROLS( Groove, Handle, Icon ) - enum IconMode + enum IconMode : quint8 { NoIcon, ShowIconWhenSelected, diff --git a/src/controls/QskTextField.h b/src/controls/QskTextField.h index 47ac596b..a171d29f 100644 --- a/src/controls/QskTextField.h +++ b/src/controls/QskTextField.h @@ -58,7 +58,7 @@ class QSK_EXPORT QskTextField : public QskControl QSK_SUBCONTROLS( Panel, Text, PlaceholderText ) QSK_STATES( ReadOnly, Editing ) - enum ActivationMode + enum ActivationMode : quint8 { NoActivation, @@ -73,7 +73,7 @@ class QSK_EXPORT QskTextField : public QskControl Q_ENUM( ActivationMode ) Q_DECLARE_FLAGS( ActivationModes, ActivationMode ) - enum EchoMode + enum EchoMode : quint8 { Normal, NoEcho, diff --git a/src/controls/QskWindow.h b/src/controls/QskWindow.h index 1dca9609..aaba6a37 100644 --- a/src/controls/QskWindow.h +++ b/src/controls/QskWindow.h @@ -29,7 +29,7 @@ class QSK_EXPORT QskWindow : public QQuickWindow using Inherited = QQuickWindow; public: - enum EventAcceptance + enum EventAcceptance : quint8 { EventProcessed = 0, EventPropagationStopped = 1 diff --git a/src/dialogs/QskDialog.h b/src/dialogs/QskDialog.h index 26f4bbda..863a456f 100644 --- a/src/dialogs/QskDialog.h +++ b/src/dialogs/QskDialog.h @@ -31,7 +31,7 @@ class QSK_EXPORT QskDialog : public QObject WRITE setTransientParent NOTIFY transientParentChanged ) public: - enum Policy + enum Policy : quint8 { EmbeddedBox, EmbeddedWindow, // not yet implemented, do we need it ? @@ -41,7 +41,7 @@ class QSK_EXPORT QskDialog : public QObject Q_ENUM( Policy ) // a.k.a QMessageBox::StandardButton or QPlatformDialogHelper::StandardButton - enum Action + enum Action : quint32 { NoAction = 0, Ok = 1 << 10, @@ -68,7 +68,7 @@ class QSK_EXPORT QskDialog : public QObject Q_DECLARE_FLAGS( Actions, Action ) // a.k.a QMessageBox::ButtonRole - enum ActionRole + enum ActionRole : qint8 { InvalidRole = -1, @@ -88,7 +88,7 @@ class QSK_EXPORT QskDialog : public QObject Q_ENUM( ActionRole ) // for building the mask in QskSkin::dialogButtonLayout - enum ButtonLayoutFlag + enum ButtonLayoutFlag : quint32 { // from QPlatformDialogHelper::ButtonRole ActionMask = 0x0FFFFFFF, @@ -98,7 +98,7 @@ class QSK_EXPORT QskDialog : public QObject Reverse = 1 << 30 }; - enum DialogCode + enum DialogCode : quint8 { Rejected = 0, Accepted diff --git a/src/dialogs/QskDialogButtonBox.cpp b/src/dialogs/QskDialogButtonBox.cpp index f71290c6..1f445b4e 100644 --- a/src/dialogs/QskDialogButtonBox.cpp +++ b/src/dialogs/QskDialogButtonBox.cpp @@ -390,7 +390,7 @@ void QskDialogButtonBox::setActions( QskDialog::Actions actions ) m_data->buttons[ i ].clear(); } - for ( int i = QskDialog::Ok; i <= QskDialog::RestoreDefaults; i <<= 1 ) + for ( uint i = QskDialog::Ok; i <= QskDialog::RestoreDefaults; i <<= 1 ) { const auto action = static_cast< QskDialog::Action >( i ); if ( action & actions ) diff --git a/src/graphic/QskGraphic.h b/src/graphic/QskGraphic.h index 34565aa0..b3834857 100644 --- a/src/graphic/QskGraphic.h +++ b/src/graphic/QskGraphic.h @@ -38,14 +38,14 @@ class QSK_EXPORT QskGraphic : public QPaintDevice using Inherited = QPaintDevice; public: - enum RenderHint + enum RenderHint : quint8 { - RenderPensUnscaled = 0x1 + RenderPensUnscaled = 1 << 0 }; typedef QFlags< RenderHint > RenderHints; - enum CommandType + enum CommandType : quint8 { VectorData = 1 << 0, RasterData = 1 << 1, diff --git a/src/graphic/QskPainterCommand.h b/src/graphic/QskPainterCommand.h index e6dd7ac0..2a4ee2d9 100644 --- a/src/graphic/QskPainterCommand.h +++ b/src/graphic/QskPainterCommand.h @@ -17,7 +17,7 @@ class QSK_EXPORT QskPainterCommand { public: //! Type of the paint command - enum Type + enum Type : qint8 { //! Invalid command Invalid = -1, diff --git a/src/graphic/QskStandardSymbol.h b/src/graphic/QskStandardSymbol.h index eea5708b..916e0b5a 100644 --- a/src/graphic/QskStandardSymbol.h +++ b/src/graphic/QskStandardSymbol.h @@ -15,7 +15,7 @@ namespace QskStandardSymbol { Q_NAMESPACE_EXPORT( QSK_EXPORT ) - enum Type + enum Type : qint16 { NoSymbol = -1, diff --git a/src/layouts/QskLayoutChain.h b/src/layouts/QskLayoutChain.h index 2c268407..9556fb8e 100644 --- a/src/layouts/QskLayoutChain.h +++ b/src/layouts/QskLayoutChain.h @@ -47,7 +47,7 @@ class QskLayoutChain QskLayoutMetrics metrics; }; - enum FillMode + enum FillMode : quint8 { Leading = 1 << 0, Trailing = 1 << 1 diff --git a/src/layouts/QskLayoutEngine2D.h b/src/layouts/QskLayoutEngine2D.h index ed1da76d..70c0df32 100644 --- a/src/layouts/QskLayoutEngine2D.h +++ b/src/layouts/QskLayoutEngine2D.h @@ -52,7 +52,7 @@ class QSK_EXPORT QskLayoutEngine2D protected: QRectF geometryAt( const QskLayoutElement*, const QRect& grid ) const; - enum + enum : quint8 { ElementCache = 1 << 0, LayoutCache = 1 << 1 diff --git a/src/nodes/QskFillNode.h b/src/nodes/QskFillNode.h index 3bd8664b..eda393f3 100644 --- a/src/nodes/QskFillNode.h +++ b/src/nodes/QskFillNode.h @@ -20,7 +20,7 @@ class QSK_EXPORT QskFillNode : public QSGGeometryNode using Inherited = QSGGeometryNode; public: - enum Coloring + enum Coloring : quint8 { Monochrome, Polychrome, @@ -30,7 +30,7 @@ class QSK_EXPORT QskFillNode : public QSGGeometryNode Conic }; - enum Hint + enum Hint : quint8 { /* Colors might be defined in the material ( QskGradientMaterial, @@ -46,7 +46,7 @@ class QSK_EXPORT QskFillNode : public QSGGeometryNode The default setting is to use colored points where possible. Note, that this is what is also done in the Qt/Quick classes. */ - PreferColoredGeometry = 1 + PreferColoredGeometry = 1 << 0 }; Q_ENUM( Hint ) diff --git a/src/nodes/QskGraduationNode.h b/src/nodes/QskGraduationNode.h index 4f3466ad..135d6e39 100644 --- a/src/nodes/QskGraduationNode.h +++ b/src/nodes/QskGraduationNode.h @@ -21,7 +21,7 @@ class QSK_EXPORT QskGraduationNode : public QskBasicLinesNode using Inherited = QskBasicLinesNode; public: - enum Alignment + enum Alignment : quint8 { Leading, Centered, diff --git a/src/nodes/QskGraduationRenderer.h b/src/nodes/QskGraduationRenderer.h index d765e33d..058255bf 100644 --- a/src/nodes/QskGraduationRenderer.h +++ b/src/nodes/QskGraduationRenderer.h @@ -33,7 +33,7 @@ class QSK_EXPORT QskGraduationRenderer Q_GADGET public: - enum Flag + enum Flag : quint8 { Backbone = 1 << 0, CenteredTickmarks = 1 << 1, diff --git a/src/nodes/QskPaintedNode.h b/src/nodes/QskPaintedNode.h index 24a7e975..4d15b53f 100644 --- a/src/nodes/QskPaintedNode.h +++ b/src/nodes/QskPaintedNode.h @@ -27,7 +27,7 @@ class QSK_EXPORT QskPaintedNode : public QSGNode OpenGL might be ignored depending on the backend used by the application. */ - enum RenderHint + enum RenderHint : quint8 { Raster, OpenGL