make QCustomPlot compatible with Qt6.2+ (qt6)

Cf the discussion here: https://www.qcustomplot.com/index.php/support/forum/2380
This commit is contained in:
Ludovic LANGE
2022-09-24 22:23:08 +02:00
parent a3bd67ea99
commit 97844ad1e5
+16 -28
View File
@@ -156,26 +156,8 @@ class QCPPolarGraph;
It provides QMetaObject-based reflection of its enums and flags via \a QCP::staticMetaObject. It provides QMetaObject-based reflection of its enums and flags via \a QCP::staticMetaObject.
*/ */
#ifndef Q_MOC_RUN
namespace QCP { namespace QCP {
#else Q_NAMESPACE
class QCP { // when in moc-run, make it look like a class, so we get Q_GADGET, Q_ENUMS/Q_FLAGS features in namespace
Q_GADGET
Q_ENUMS(ExportPen)
Q_ENUMS(ResolutionUnit)
Q_ENUMS(SignDomain)
Q_ENUMS(MarginSide)
Q_FLAGS(MarginSides)
Q_ENUMS(AntialiasedElement)
Q_FLAGS(AntialiasedElements)
Q_ENUMS(PlottingHint)
Q_FLAGS(PlottingHints)
Q_ENUMS(Interaction)
Q_FLAGS(Interactions)
Q_ENUMS(SelectionRectMode)
Q_ENUMS(SelectionType)
public:
#endif
/*! /*!
Defines the different units in which the image resolution can be specified in the export Defines the different units in which the image resolution can be specified in the export
@@ -318,6 +300,20 @@ enum SelectionType { stNone ///< The plottable is not selectable
,stMultipleDataRanges ///< Any combination of data points/ranges can be selected ,stMultipleDataRanges ///< Any combination of data points/ranges can be selected
}; };
Q_ENUM_NS(ExportPen)
Q_ENUM_NS(ResolutionUnit)
Q_ENUM_NS(SignDomain)
Q_ENUM_NS(MarginSide)
Q_FLAG_NS(MarginSides)
Q_ENUM_NS(AntialiasedElement)
Q_FLAG_NS(AntialiasedElements)
Q_ENUM_NS(PlottingHint)
Q_FLAG_NS(PlottingHints)
Q_ENUM_NS(Interaction)
Q_FLAG_NS(Interactions)
Q_ENUM_NS(SelectionRectMode)
Q_ENUM_NS(SelectionType)
/*! \internal /*! \internal
Returns whether the specified \a value is considered an invalid data value for plottables (i.e. Returns whether the specified \a value is considered an invalid data value for plottables (i.e.
@@ -386,15 +382,7 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::AntialiasedElements)
Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::PlottingHints) Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::PlottingHints)
Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::MarginSides) Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::MarginSides)
Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::Interactions) Q_DECLARE_OPERATORS_FOR_FLAGS(QCP::Interactions)
Q_DECLARE_METATYPE(QCP::ExportPen) //no need to use Q_DECLARE_METATYPE on enum since Q_ENUM_NS adds enum as metatype automatically
Q_DECLARE_METATYPE(QCP::ResolutionUnit)
Q_DECLARE_METATYPE(QCP::SignDomain)
Q_DECLARE_METATYPE(QCP::MarginSide)
Q_DECLARE_METATYPE(QCP::AntialiasedElement)
Q_DECLARE_METATYPE(QCP::PlottingHint)
Q_DECLARE_METATYPE(QCP::Interaction)
Q_DECLARE_METATYPE(QCP::SelectionRectMode)
Q_DECLARE_METATYPE(QCP::SelectionType)
/* end of 'src/global.h' */ /* end of 'src/global.h' */