0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-10-03 12:04:05 +03:00

supporting the new Q_ENUM() with Q_ENUMS() backwards compatibility.

This commit is contained in:
HatEmU
2020-03-03 03:13:46 +01:00
parent a8cbf68347
commit 5626e9b293
10 changed files with 91 additions and 15 deletions

View File

@@ -2,6 +2,7 @@
#define LRCHARTITEM_H
#include "lritemdesignintf.h"
#include "lrglobal.h"
#include <QtGlobal>
namespace LimeReport{
@@ -32,7 +33,11 @@ class SeriesItem : public QObject{
Q_PROPERTY(SeriesItemPreferredType preferredType READ preferredType WRITE setPreferredType)
public:
enum SeriesItemPreferredType {Bar, Line};
#if (QT_VERSION >= QT_VERSION_CHECK(5,5, 0))
Q_ENUM(SeriesItemPreferredType)
#else
Q_ENUM(SeriesItemPreferredType)
#endif
SeriesItem(QObject* parent = 0) : QObject(parent), m_preferredType(Bar){}
QString name() const;
void setName(const QString &name);
@@ -126,11 +131,17 @@ class ChartItem : public LimeReport::ItemDesignIntf
public:
enum LegendAlign{LegendAlignTop,LegendAlignCenter,LegendAlignBottom};
Q_ENUM(LegendAlign)
enum TitleAlign{TitleAlignLeft, TitleAlignCenter, TitleAlignRight};
Q_ENUM(TitleAlign)
enum ChartType{Pie, VerticalBar, HorizontalBar, Lines};
#if (QT_VERSION >= QT_VERSION_CHECK(5,5, 0))
Q_ENUM(LegendAlign)
Q_ENUM(TitleAlign)
Q_ENUM(ChartType)
#else
Q_ENUMS(LegendAlign)
Q_ENUMS(TitleAlign)
Q_ENUMS(ChartType)
#endif
ChartItem(QObject* owner, QGraphicsItem* parent);
~ChartItem();