Menu ▾ ▴

#393 qwt_picker.h:107:5: error: macro 'Q_ENUMS' has been marked as deprecated: Use Q_ENUM instead

None
closed
nobody
None
5
2026-11-05
2026-11-02
jschueller
No

seems qt 6.12 warns about deprecated Q_ENUMS now:

/opt/homebrew/opt/qwt/lib/qwt.framework/Headers/qwt_picker.h:107:5: error: macro 'Q_ENUMS' has been marked as deprecated: Use Q_ENUM instead. [-Werror,-Wdeprecated-pragma]
  107 |     Q_ENUMS( RubberBand DisplayMode ResizeMode )
      |     ^
/opt/homebrew/lib/QtCore.framework/Headers/qtmetamacros.h:69:1: note: macro marked 'deprecated' here
   69 | QT_DEPRECATED_MACRO_6_12(Q_ENUMS, "Use Q_ENUM instead.")
      | ^
/opt/homebrew/lib/QtCore.framework/Headers/qtdeprecationmarkers.h:248:48: note: expanded from macro 'QT_DEPRECATED_MACRO_6_12'
  248 | # define QT_DEPRECATED_MACRO_6_12(macro, text) QT_DEPRECATED_MACRO(macro, text)
      |                                                ^
/opt/homebrew/lib/QtCore.framework/Headers/qtdeprecationmarkers.h:38:44: note: expanded from macro 'QT_DEPRECATED_MACRO'
   38 | #  define QT_DEPRECATED_MACRO(macro, text) Q_DECL_DEPRECATED_MACRO(macro, text)
      |                                            ^
/opt/homebrew/lib/QtCore.framework/Headers/qcompilerdetection.h:1025:48: note: expanded from macro 'Q_DECL_DEPRECATED_MACRO'
 1025 | #  define Q_DECL_DEPRECATED_MACRO(macro, text) QT_DO_PRAGMA(clang deprecated(macro, text))
      |                                                ^
/opt/homebrew/lib/QtCore.framework/Headers/qcompilerdetection.h:1223:49: note: expanded from macro 'QT_DO_PRAGMA'
 1223 | #define QT_DO_PRAGMA(text)                      _Pragma(#text)
      |                                                 ^
<scratch space>:164:49: note: expanded from here
  164 |  clang deprecated(Q_ENUMS, "Use Q_ENUM instead.")

luckily it seems we can use Q_ENUM instead which is available since qt >=5.5:

diff --git a/src/qwt_dial.h b/src/qwt_dial.h
index 19bbca9..46216bd 100644
--- a/src/qwt_dial.h
+++ b/src/qwt_dial.h
@@ -53,8 +53,6 @@ class QWT_EXPORT QwtDial : public QwtAbstractSlider
 {
     Q_OBJECT


-    Q_ENUMS( Shadow Mode Direction )
-
     Q_PROPERTY( int lineWidth READ lineWidth WRITE setLineWidth )
     Q_PROPERTY( Shadow frameShadow READ frameShadow WRITE setFrameShadow )
     Q_PROPERTY( Mode mode READ mode WRITE setMode )
@@ -83,6 +81,7 @@ class QWT_EXPORT QwtDial : public QwtAbstractSlider
         //! QFrame::Sunken
         Sunken = QFrame::Sunken
     };
+    Q_ENUM( Shadow )

     //! Mode controlling whether the needle or the scale is rotating
     enum Mode
@@ -93,6 +92,7 @@ class QWT_EXPORT QwtDial : public QwtAbstractSlider
         //! The needle is fixed, the scales are rotating
         RotateScale
     };

+    Q_ENUM( Mode )

     explicit QwtDial( QWidget* parent = nullptr );
     ~QwtDial() override;
diff --git a/src/qwt_knob.h b/src/qwt_knob.h
index 278571d..5a8cf30 100644
--- a/src/qwt_knob.h
+++ b/src/qwt_knob.h
@@ -44,8 +44,6 @@ class QWT_EXPORT QwtKnob : public QwtAbstractSlider
 {
     Q_OBJECT


-    Q_ENUMS ( KnobStyle MarkerStyle )
-
     Q_PROPERTY( KnobStyle knobStyle READ knobStyle WRITE setKnobStyle )
     Q_PROPERTY( int knobWidth READ knobWidth WRITE setKnobWidth )
     Q_PROPERTY( Qt::Alignment alignment READ alignment WRITE setAlignment )
@@ -84,6 +82,7 @@ class QWT_EXPORT QwtKnob : public QwtAbstractSlider
          */
         Styled
     };
+    Q_ENUM( KnobStyle )

     /*!
         \brief Marker type
@@ -119,6 +118,7 @@ class QWT_EXPORT QwtKnob : public QwtAbstractSlider
          */
         Notch
     };

+    Q_ENUM( MarkerStyle )

     explicit QwtKnob( QWidget* parent = nullptr );
     virtual ~QwtKnob();
diff --git a/src/qwt_picker.h b/src/qwt_picker.h
index d188b18..b981da6 100644
--- a/src/qwt_picker.h
+++ b/src/qwt_picker.h
@@ -105,8 +105,6 @@ class QWT_EXPORT QwtPicker : public QObject, public QwtEventPattern
 {
     Q_OBJECT


-    Q_ENUMS( RubberBand DisplayMode ResizeMode )
-
     Q_PROPERTY( bool isEnabled READ isEnabled WRITE setEnabled )
     Q_PROPERTY( ResizeMode resizeMode READ resizeMode WRITE setResizeMode )

@@ -154,6 +152,7 @@ class QWT_EXPORT QwtPicker : public QObject, public QwtEventPattern
          */
         UserRubberBand = 100
     };

+    Q_ENUM( RubberBand )

     /*!
        \brief Display mode
@@ -170,6 +169,7 @@ class QWT_EXPORT QwtPicker : public QObject, public QwtEventPattern
         //! Display only when the selection is active
         ActiveOnly
     };

+    Q_ENUM( DisplayMode )

     /*!
        Controls what to do with the selected points of an active
@@ -187,6 +187,7 @@ class QWT_EXPORT QwtPicker : public QObject, public QwtEventPattern
         //! All points remain unchanged.
         KeepSize
     };

+    Q_ENUM( ResizeMode )

     explicit QwtPicker( QWidget* parent );
     explicit QwtPicker( RubberBand rubberBand,
diff --git a/src/qwt_slider.h b/src/qwt_slider.h
index 9cf4818..71902ab 100644
--- a/src/qwt_slider.h
+++ b/src/qwt_slider.h
@@ -33,8 +33,6 @@ class QWT_EXPORT QwtSlider : public QwtAbstractSlider
 {
     Q_OBJECT


-    Q_ENUMS( ScalePosition BackgroundStyle )
-
     Q_PROPERTY( Qt::Orientation orientation
         READ orientation WRITE setOrientation )
     Q_PROPERTY( ScalePosition scalePosition READ scalePosition
@@ -64,6 +62,7 @@ class QWT_EXPORT QwtSlider : public QwtAbstractSlider
         //! The scale is left of a vertical or above a horizontal slider
         TrailingScale
     };
+    Q_ENUM( ScalePosition )

     explicit QwtSlider( QWidget* parent = nullptr );
     explicit QwtSlider( Qt::Orientation, QWidget* parent = nullptr );
diff --git a/src/qwt_thermo.h b/src/qwt_thermo.h
index 6775964..7378f48 100644
--- a/src/qwt_thermo.h
+++ b/src/qwt_thermo.h
@@ -49,9 +49,6 @@ class QWT_EXPORT QwtThermo : public QwtAbstractScale
 {
     Q_OBJECT


-    Q_ENUMS( ScalePosition )
-    Q_ENUMS( OriginMode )
-
     Q_PROPERTY( Qt::Orientation orientation
         READ orientation WRITE setOrientation )
     Q_PROPERTY( ScalePosition scalePosition
@@ -83,6 +80,7 @@ class QWT_EXPORT QwtThermo : public QwtAbstractScale
         //! The scale is left of a vertical or above of a horizontal slider
         TrailingScale
     };
+    Q_ENUM( ScalePosition )

     /*!
        Origin mode. This property specifies where the beginning of the liquid
@@ -101,6 +99,7 @@ class QWT_EXPORT QwtThermo : public QwtAbstractScale
         //! The origin is specified using the origin() property
         OriginCustom
     };

+    Q_ENUM( OriginMode )

     explicit QwtThermo( QWidget* parent = nullptr );
     ~QwtThermo() override;

Discussion

  • Uwe Rathmann

    Uwe Rathmann - 2026-11-05
     
  • Uwe Rathmann

    Uwe Rathmann - 2026-11-05
    • status: open --> closed
    • Group: -->
     
  • Uwe Rathmann

    Uwe Rathmann - 2026-11-05

    fixed in develop

     
  • Anonymous

    Anonymous - 2026-11-05

    thanks!
    do you have a schedule for version 6.4 yet ?

     
  • Uwe Rathmann

    Uwe Rathmann - 2026-11-05

    Dropping Qt 4.x finally allows me to do very basic things ( like using c++11 ) and I will try to "modernize" the code base. This is mostly stupid work, but touches a lot of code.

    So no I do not have a schedule yet, but I expect to have something close to a beta version around end of this year.

     

Anonymous
Anonymous

Add attachments
Cancel