From a8cbf6834718a3c7f18968d372ea7f53ba181353 Mon Sep 17 00:00:00 2001 From: HatEmU Date: Mon, 17 Feb 2020 05:17:02 +0100 Subject: [PATCH 1/3] Replaced the deprecated Q_ENUMS() with the currently supported Q_ENUM() --- include/lrglobal.h | 2 +- limereport/items/lrabstractlayout.h | 2 +- limereport/items/lrbarcodeitem.h | 6 +++--- limereport/items/lrchartitem.h | 8 ++++---- limereport/items/lrimageitem.h | 2 +- limereport/items/lrshapeitem.h | 2 +- limereport/items/lrtextitem.h | 6 +++--- limereport/lrbanddesignintf.h | 2 +- limereport/lrbasedesignintf.h | 13 ++++++++----- limereport/lrglobal.h | 2 +- limereport/lritemdesignintf.h | 2 +- limereport/lrpageitemdesignintf.h | 6 +++--- 12 files changed, 28 insertions(+), 25 deletions(-) diff --git a/include/lrglobal.h b/include/lrglobal.h index 5541a1b..c647294 100644 --- a/include/lrglobal.h +++ b/include/lrglobal.h @@ -157,7 +157,7 @@ namespace Const{ { public: enum VariableDataType {Undefined, String, Bool, Int, Real, Date, Time, DateTime}; - Q_ENUMS(VariableDataType) + Q_ENUM(VariableDataType) private: Enums(){} Q_GADGET diff --git a/limereport/items/lrabstractlayout.h b/limereport/items/lrabstractlayout.h index 07a1d9f..e4c5010 100644 --- a/limereport/items/lrabstractlayout.h +++ b/limereport/items/lrabstractlayout.h @@ -8,11 +8,11 @@ namespace LimeReport{ class AbstractLayout: public LayoutDesignIntf { Q_OBJECT - Q_ENUMS(LayoutType) Q_PROPERTY(bool hideEmptyItems READ hideEmptyItems WRITE setHideEmptyItems) Q_PROPERTY(int layoutSpacing READ layoutSpacing WRITE setLayoutSpacing) public: enum LayoutType{Layout,Table}; + Q_ENUM(LayoutType) AbstractLayout(QString xmlTag, QObject *owner = 0, QGraphicsItem *parent = 0); ~AbstractLayout(); QList& layoutsChildren(); diff --git a/limereport/items/lrbarcodeitem.h b/limereport/items/lrbarcodeitem.h index 3badbd5..47fbdcd 100644 --- a/limereport/items/lrbarcodeitem.h +++ b/limereport/items/lrbarcodeitem.h @@ -35,9 +35,6 @@ namespace LimeReport{ class BarcodeItem : public LimeReport::ContentItemDesignIntf { Q_OBJECT - Q_ENUMS(BarcodeType) - Q_ENUMS(AngleType) - Q_ENUMS(InputMode) Q_PROPERTY(QString content READ content WRITE setContent) Q_PROPERTY(BarcodeType barcodeType READ barcodeType WRITE setBarcodeType ) Q_PROPERTY(QString datasource READ datasource WRITE setDatasource) @@ -144,7 +141,9 @@ public: UPNQR =143 }; + Q_ENUM(BarcodeType) enum AngleType{Angle0,Angle90,Angle180,Angle270}; + Q_ENUM(AngleType) enum InputMode{ DATA_INPUT_MODE = 0, UNICODE_INPUT_MODE = 1, @@ -152,6 +151,7 @@ public: KANJI_INPUT_MODE = 3, SJIS_INPUT_MODE = 4 }; + Q_ENUM(InputMode) BarcodeItem(QObject *owner, QGraphicsItem *parent); ~BarcodeItem(); virtual BaseDesignIntf* createSameTypeItem(QObject *owner, QGraphicsItem *parent); diff --git a/limereport/items/lrchartitem.h b/limereport/items/lrchartitem.h index 8929668..50ae71f 100644 --- a/limereport/items/lrchartitem.h +++ b/limereport/items/lrchartitem.h @@ -30,9 +30,9 @@ class SeriesItem : public QObject{ Q_PROPERTY(QString labelsColumn READ labelsColumn WRITE setLabelsColumn ) Q_PROPERTY(QColor color READ color WRITE setColor) Q_PROPERTY(SeriesItemPreferredType preferredType READ preferredType WRITE setPreferredType) - Q_ENUMS(SeriesItemPreferredType) public: enum SeriesItemPreferredType {Bar, Line}; + Q_ENUM(SeriesItemPreferredType) SeriesItem(QObject* parent = 0) : QObject(parent), m_preferredType(Bar){} QString name() const; void setName(const QString &name); @@ -114,9 +114,6 @@ protected: class ChartItem : public LimeReport::ItemDesignIntf { Q_OBJECT - Q_ENUMS(LegendAlign) - Q_ENUMS(TitleAlign) - Q_ENUMS(ChartType) Q_PROPERTY(ACollectionProperty series READ fakeCollectionReader WRITE setSeries) Q_PROPERTY(QString datasource READ datasource WRITE setDatasource) Q_PROPERTY(QString chartTitle READ chartTitle WRITE setChartTitle) @@ -129,8 +126,11 @@ 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}; + Q_ENUM(ChartType) ChartItem(QObject* owner, QGraphicsItem* parent); ~ChartItem(); diff --git a/limereport/items/lrimageitem.h b/limereport/items/lrimageitem.h index 587d39d..a615592 100644 --- a/limereport/items/lrimageitem.h +++ b/limereport/items/lrimageitem.h @@ -36,7 +36,6 @@ namespace LimeReport{ class ImageItem : public ItemDesignIntf, public IPainterProxy { Q_OBJECT - Q_ENUMS(Format) Q_PROPERTY(QImage image READ image WRITE setImage) Q_PROPERTY(int opacity READ opacity WRITE setOpacity) Q_PROPERTY(QString datasource READ datasource WRITE setDatasource) @@ -57,6 +56,7 @@ public: Hex = 1, Base64 = 2 }; + Q_ENUM(Format) ImageItem(QObject *owner, QGraphicsItem *parent); virtual void paint(QPainter *ppainter, const QStyleOptionGraphicsItem *option, QWidget *widget); diff --git a/limereport/items/lrshapeitem.h b/limereport/items/lrshapeitem.h index 639faba..62cde2a 100644 --- a/limereport/items/lrshapeitem.h +++ b/limereport/items/lrshapeitem.h @@ -36,7 +36,6 @@ namespace LimeReport{ class ShapeItem: public LimeReport::ItemDesignIntf { Q_OBJECT - Q_ENUMS(ShapeType) Q_PROPERTY(ShapeType shape READ shapeType WRITE setShapeType) Q_PROPERTY(QColor shapeColor READ shapeColor WRITE setShapeColor) Q_PROPERTY(QColor shapeBrushColor READ shapeBrushColor WRITE setShapeBrushColor) @@ -47,6 +46,7 @@ class ShapeItem: public LimeReport::ItemDesignIntf Q_PROPERTY(int cornerRadius READ cornerRadius WRITE setCornerRadius) public: enum ShapeType{HorizontalLine,VerticalLine,Ellipse,Rectangle}; + Q_ENUM(ShapeType) ShapeItem(QObject *owner, QGraphicsItem *parent); virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); void setShapeColor(QColor value); diff --git a/limereport/items/lrtextitem.h b/limereport/items/lrtextitem.h index aa624eb..5c35cf2 100644 --- a/limereport/items/lrtextitem.h +++ b/limereport/items/lrtextitem.h @@ -43,9 +43,6 @@ namespace LimeReport { class Tag; class TextItem : public ContentItemDesignIntf, IPageInit { Q_OBJECT - Q_ENUMS(AutoWidth) - Q_ENUMS(AngleType) - Q_ENUMS(ValueType) Q_PROPERTY(QString content READ content WRITE setContent) Q_PROPERTY(int margin READ marginSize WRITE setMarginSize) Q_PROPERTY(Qt::Alignment alignment READ alignment() WRITE setAlignment) @@ -79,8 +76,11 @@ class TextItem : public ContentItemDesignIntf, IPageInit { public: enum AutoWidth{NoneAutoWidth, MaxWordLength, MaxStringLength}; + Q_ENUM(AutoWidth) enum AngleType{Angle0, Angle90, Angle180, Angle270, Angle45, Angle315}; + Q_ENUM(AngleType) enum ValueType{Default, DateTime, Double}; + Q_ENUM(ValueType) void Init(); TextItem(QObject* owner=0, QGraphicsItem* parent=0); diff --git a/limereport/lrbanddesignintf.h b/limereport/lrbanddesignintf.h index 9a0c350..e144142 100644 --- a/limereport/lrbanddesignintf.h +++ b/limereport/lrbanddesignintf.h @@ -114,7 +114,6 @@ class BandDesignIntf : public ItemsContainerDesignInft Q_PROPERTY(BGMode backgroundMode READ backgroundMode WRITE setBackgroundModeProperty) Q_PROPERTY(int backgroundOpacity READ opacity WRITE setBackgroundOpacity) Q_PROPERTY(int shiftItems READ shiftItems WRITE setShiftItems) - Q_ENUMS(BandColumnsLayoutType) friend class BandMarker; friend class BandNameLabel; friend class ReportRender; @@ -139,6 +138,7 @@ public: enum BandColumnsLayoutType{ Horizontal, Vertical, VerticalUniform }; + Q_ENUM(BandColumnsLayoutType) BandDesignIntf(BandsType bandType, const QString& xmlTypeName, QObject* owner = 0, QGraphicsItem* parent=0); ~BandDesignIntf(); diff --git a/limereport/lrbasedesignintf.h b/limereport/lrbasedesignintf.h index 597d04a..b434295 100644 --- a/limereport/lrbasedesignintf.h +++ b/limereport/lrbasedesignintf.h @@ -84,12 +84,7 @@ class BaseDesignIntf : public QObject, public QGraphicsItem, public ICollectionContainer, public ObjectLoadingStateIntf { Q_OBJECT Q_INTERFACES(QGraphicsItem) - Q_ENUMS(BGMode) - Q_ENUMS(Qt::BrushStyle) - Q_ENUMS(BrushStyle) - Q_ENUMS(ItemAlign) Q_FLAGS(BorderLines) - Q_ENUMS(UnitType) Q_PROPERTY(QRect geometry READ geometry WRITE setGeometryProperty NOTIFY geometryChanged) Q_PROPERTY(ACollectionProperty children READ fakeCollectionReader DESIGNABLE false) Q_PROPERTY(qreal zOrder READ zValue WRITE setZValueProperty DESIGNABLE false) @@ -103,6 +98,7 @@ class BaseDesignIntf : friend class ReportRender; public: enum BGMode { TransparentMode, OpaqueMode}; + Q_ENUM(BGMode) enum BrushStyle{ NoBrush, SolidPattern, @@ -118,6 +114,7 @@ public: CrossPattern, BDiagPattern, FDiagPattern }; + Q_ENUM(BrushStyle) enum ResizeFlags { Fixed = 0, ResizeLeft = 1, @@ -126,11 +123,13 @@ public: ResizeBottom = 8, AllDirections = 15 }; + Q_ENUM(ResizeFlags) enum MoveFlags { None = 0, LeftRight=1, TopBotom=2, All=3 }; + Q_ENUM(MoveFlags) enum BorderSide { NoLine = 0, TopLine = 1, @@ -139,9 +138,13 @@ public: RightLine = 8, AllLines = 15 }; + Q_ENUM(BorderSide) enum ObjectState {ObjectLoading, ObjectLoaded, ObjectCreated}; + Q_ENUM(ObjectState) enum ItemAlign {LeftItemAlign,RightItemAlign,CenterItemAlign,ParentWidthItemAlign,DesignedItemAlign}; + Q_ENUM(ItemAlign) enum UnitType {Millimeters, Inches}; + Q_ENUM(UnitType) // enum ExpandType {EscapeSymbols, NoEscapeSymbols, ReplaceHTMLSymbols}; Q_DECLARE_FLAGS(BorderLines, BorderSide) Q_DECLARE_FLAGS(ItemMode,ItemModes) diff --git a/limereport/lrglobal.h b/limereport/lrglobal.h index 5541a1b..c647294 100644 --- a/limereport/lrglobal.h +++ b/limereport/lrglobal.h @@ -157,7 +157,7 @@ namespace Const{ { public: enum VariableDataType {Undefined, String, Bool, Int, Real, Date, Time, DateTime}; - Q_ENUMS(VariableDataType) + Q_ENUM(VariableDataType) private: Enums(){} Q_GADGET diff --git a/limereport/lritemdesignintf.h b/limereport/lritemdesignintf.h index a805542..0718f50 100644 --- a/limereport/lritemdesignintf.h +++ b/limereport/lritemdesignintf.h @@ -41,9 +41,9 @@ class ItemDesignIntf : public BaseDesignIntf Q_PROPERTY(LocationType itemLocation READ itemLocation WRITE setItemLocation) Q_PROPERTY(bool stretchToMaxHeight READ stretchToMaxHeight WRITE setStretchToMaxHeight) Q_PROPERTY(ItemAlign itemAlign READ itemAlign WRITE setItemAlign) - Q_ENUMS(LocationType) public: enum LocationType{Band,Page}; + Q_ENUM(LocationType) ItemDesignIntf(const QString& xmlTypeName, QObject* owner = 0,QGraphicsItem* parent = 0); LocationType itemLocation(){return m_itemLocation;} void setItemLocation(LocationType location); diff --git a/limereport/lrpageitemdesignintf.h b/limereport/lrpageitemdesignintf.h index f804776..dfc865b 100644 --- a/limereport/lrpageitemdesignintf.h +++ b/limereport/lrpageitemdesignintf.h @@ -42,9 +42,6 @@ class ReportRender; class PageItemDesignIntf : public ItemsContainerDesignInft { Q_OBJECT - Q_ENUMS(Orientation) - Q_ENUMS(PageSize) - Q_ENUMS(PrintBehavior) Q_PROPERTY(int topMargin READ topMargin WRITE setTopMargin) Q_PROPERTY(int bottomMargin READ bottomMargin WRITE setBottomMargin) Q_PROPERTY(int rightMargin READ rightMargin WRITE setRightMargin) @@ -67,7 +64,9 @@ class PageItemDesignIntf : public ItemsContainerDesignInft friend class ReportRender; public: enum Orientation { Portrait = QPrinter::Portrait, Landscape = QPrinter::Landscape }; + Q_ENUM(Orientation) enum PrintBehavior {Scale, Split}; + Q_ENUM(PrintBehavior) enum PageSize { A4 = QPrinter::A4, B5 = QPrinter::B5, Letter = QPrinter::Letter, Legal = QPrinter::Legal, Executive = QPrinter::Executive, @@ -80,6 +79,7 @@ public: Ledger = QPrinter::Ledger, Tabloid = QPrinter::Tabloid, Custom = QPrinter::Custom, NPageSize = Custom }; + Q_ENUM(PageSize) typedef QList BandsList; typedef QList::const_iterator BandsIterator; typedef QSharedPointer Ptr; From 5626e9b2937bb06666793da08a543bb8cbfbad5f Mon Sep 17 00:00:00 2001 From: HatEmU Date: Tue, 3 Mar 2020 03:13:46 +0100 Subject: [PATCH 2/3] supporting the new Q_ENUM() with Q_ENUMS() backwards compatibility. --- limereport/items/lrbarcodeitem.h | 13 +++++++++++-- limereport/items/lrchartitem.h | 15 +++++++++++++-- limereport/items/lrimageitem.h | 5 +++++ limereport/items/lrshapeitem.h | 5 +++++ limereport/items/lrtextitem.h | 11 +++++++++-- limereport/lrbanddesignintf.h | 4 ++++ limereport/lrbasedesignintf.h | 32 ++++++++++++++++++++++++------- limereport/lrglobal.h | 5 +++++ limereport/lritemdesignintf.h | 4 ++++ limereport/lrpageitemdesignintf.h | 12 ++++++++++-- 10 files changed, 91 insertions(+), 15 deletions(-) diff --git a/limereport/items/lrbarcodeitem.h b/limereport/items/lrbarcodeitem.h index 47fbdcd..8dc091d 100644 --- a/limereport/items/lrbarcodeitem.h +++ b/limereport/items/lrbarcodeitem.h @@ -30,6 +30,7 @@ #ifndef LRBARCODEITEM_H #define LRBARCODEITEM_H #include "lritemdesignintf.h" +#include namespace LimeReport{ @@ -141,9 +142,9 @@ public: UPNQR =143 }; - Q_ENUM(BarcodeType) + enum AngleType{Angle0,Angle90,Angle180,Angle270}; - Q_ENUM(AngleType) + enum InputMode{ DATA_INPUT_MODE = 0, UNICODE_INPUT_MODE = 1, @@ -151,7 +152,15 @@ public: KANJI_INPUT_MODE = 3, SJIS_INPUT_MODE = 4 }; +#if (QT_VERSION >= QT_VERSION_CHECK(5,5, 0)) + Q_ENUM(BarcodeType) + Q_ENUM(AngleType) Q_ENUM(InputMode) +#else + Q_ENUMS(BarcodeType) + Q_ENUMS(AngleType) + Q_ENUMS(InputMode) +#endif BarcodeItem(QObject *owner, QGraphicsItem *parent); ~BarcodeItem(); virtual BaseDesignIntf* createSameTypeItem(QObject *owner, QGraphicsItem *parent); diff --git a/limereport/items/lrchartitem.h b/limereport/items/lrchartitem.h index 50ae71f..b2cd881 100644 --- a/limereport/items/lrchartitem.h +++ b/limereport/items/lrchartitem.h @@ -2,6 +2,7 @@ #define LRCHARTITEM_H #include "lritemdesignintf.h" #include "lrglobal.h" +#include 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(); diff --git a/limereport/items/lrimageitem.h b/limereport/items/lrimageitem.h index a615592..e86e92a 100644 --- a/limereport/items/lrimageitem.h +++ b/limereport/items/lrimageitem.h @@ -30,6 +30,7 @@ #ifndef LRIMAGEITEM_H #define LRIMAGEITEM_H #include "lritemdesignintf.h" +#include namespace LimeReport{ @@ -56,7 +57,11 @@ public: Hex = 1, Base64 = 2 }; +#if (QT_VERSION >= QT_VERSION_CHECK(5,5, 0)) Q_ENUM(Format) +#else + Q_ENUMS(Format) +#endif ImageItem(QObject *owner, QGraphicsItem *parent); virtual void paint(QPainter *ppainter, const QStyleOptionGraphicsItem *option, QWidget *widget); diff --git a/limereport/items/lrshapeitem.h b/limereport/items/lrshapeitem.h index 62cde2a..1516aad 100644 --- a/limereport/items/lrshapeitem.h +++ b/limereport/items/lrshapeitem.h @@ -30,6 +30,7 @@ #ifndef LRSHAPEITEM_H #define LRSHAPEITEM_H #include "lritemdesignintf.h" +#include namespace LimeReport{ @@ -46,7 +47,11 @@ class ShapeItem: public LimeReport::ItemDesignIntf Q_PROPERTY(int cornerRadius READ cornerRadius WRITE setCornerRadius) public: enum ShapeType{HorizontalLine,VerticalLine,Ellipse,Rectangle}; +#if (QT_VERSION >= QT_VERSION_CHECK(5,5, 0)) Q_ENUM(ShapeType) +#else + Q_ENUMS(ShapeType) +#endif ShapeItem(QObject *owner, QGraphicsItem *parent); virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); void setShapeColor(QColor value); diff --git a/limereport/items/lrtextitem.h b/limereport/items/lrtextitem.h index 5c35cf2..fbd2bfd 100644 --- a/limereport/items/lrtextitem.h +++ b/limereport/items/lrtextitem.h @@ -33,6 +33,7 @@ #include #include #include +#include #include "lritemdesignintf.h" #include "lritemdesignintf.h" @@ -76,11 +77,17 @@ class TextItem : public ContentItemDesignIntf, IPageInit { public: enum AutoWidth{NoneAutoWidth, MaxWordLength, MaxStringLength}; - Q_ENUM(AutoWidth) enum AngleType{Angle0, Angle90, Angle180, Angle270, Angle45, Angle315}; - Q_ENUM(AngleType) enum ValueType{Default, DateTime, Double}; +#if (QT_VERSION >= QT_VERSION_CHECK(5,5, 0)) + Q_ENUM(AutoWidth) + Q_ENUM(AngleType) Q_ENUM(ValueType) +#else + Q_ENUMS(AutoWidth) + Q_ENUMS(AngleType) + Q_ENUMS(ValueType) +#endif void Init(); TextItem(QObject* owner=0, QGraphicsItem* parent=0); diff --git a/limereport/lrbanddesignintf.h b/limereport/lrbanddesignintf.h index e144142..d093831 100644 --- a/limereport/lrbanddesignintf.h +++ b/limereport/lrbanddesignintf.h @@ -138,7 +138,11 @@ public: enum BandColumnsLayoutType{ Horizontal, Vertical, VerticalUniform }; +#if (QT_VERSION >= QT_VERSION_CHECK(5,5, 0)) Q_ENUM(BandColumnsLayoutType) +#else + Q_ENUMS(BandColumnsLayoutType) +#endif BandDesignIntf(BandsType bandType, const QString& xmlTypeName, QObject* owner = 0, QGraphicsItem* parent=0); ~BandDesignIntf(); diff --git a/limereport/lrbasedesignintf.h b/limereport/lrbasedesignintf.h index b434295..d9fbfc9 100644 --- a/limereport/lrbasedesignintf.h +++ b/limereport/lrbasedesignintf.h @@ -98,7 +98,7 @@ class BaseDesignIntf : friend class ReportRender; public: enum BGMode { TransparentMode, OpaqueMode}; - Q_ENUM(BGMode) + enum BrushStyle{ NoBrush, SolidPattern, @@ -114,7 +114,7 @@ public: CrossPattern, BDiagPattern, FDiagPattern }; - Q_ENUM(BrushStyle) + enum ResizeFlags { Fixed = 0, ResizeLeft = 1, @@ -123,13 +123,13 @@ public: ResizeBottom = 8, AllDirections = 15 }; - Q_ENUM(ResizeFlags) + enum MoveFlags { None = 0, LeftRight=1, TopBotom=2, All=3 }; - Q_ENUM(MoveFlags) + enum BorderSide { NoLine = 0, TopLine = 1, @@ -138,13 +138,31 @@ public: RightLine = 8, AllLines = 15 }; - Q_ENUM(BorderSide) + enum ObjectState {ObjectLoading, ObjectLoaded, ObjectCreated}; - Q_ENUM(ObjectState) + enum ItemAlign {LeftItemAlign,RightItemAlign,CenterItemAlign,ParentWidthItemAlign,DesignedItemAlign}; - Q_ENUM(ItemAlign) + enum UnitType {Millimeters, Inches}; +#if (QT_VERSION >= QT_VERSION_CHECK(5,5, 0)) + Q_ENUM(BGMode) + Q_ENUM(BrushStyle) + Q_ENUM(ResizeFlags) + Q_ENUM(MoveFlags) + Q_ENUM(BorderSide) + Q_ENUM(ObjectState) + Q_ENUM(ItemAlign) Q_ENUM(UnitType) +#else + Q_ENUMS(BGMode) + Q_ENUMS(BrushStyle) + Q_ENUMS(ResizeFlags) + Q_ENUMS(MoveFlags) + Q_ENUMS(BorderSide) + Q_ENUMS(ObjectState) + Q_ENUMS(ItemAlign) + Q_ENUMS(UnitType) +#endif // enum ExpandType {EscapeSymbols, NoEscapeSymbols, ReplaceHTMLSymbols}; Q_DECLARE_FLAGS(BorderLines, BorderSide) Q_DECLARE_FLAGS(ItemMode,ItemModes) diff --git a/limereport/lrglobal.h b/limereport/lrglobal.h index c647294..298e0d8 100644 --- a/limereport/lrglobal.h +++ b/limereport/lrglobal.h @@ -33,6 +33,7 @@ #include #include #include +#include #if defined(LIMEREPORT_EXPORTS) # define LIMEREPORT_EXPORT Q_DECL_EXPORT @@ -157,7 +158,11 @@ namespace Const{ { public: enum VariableDataType {Undefined, String, Bool, Int, Real, Date, Time, DateTime}; +#if (QT_VERSION >= QT_VERSION_CHECK(5,5, 0)) Q_ENUM(VariableDataType) +#else + Q_ENUMS(VariableDataType) +#endif private: Enums(){} Q_GADGET diff --git a/limereport/lritemdesignintf.h b/limereport/lritemdesignintf.h index 0718f50..ad95e25 100644 --- a/limereport/lritemdesignintf.h +++ b/limereport/lritemdesignintf.h @@ -43,7 +43,11 @@ class ItemDesignIntf : public BaseDesignIntf Q_PROPERTY(ItemAlign itemAlign READ itemAlign WRITE setItemAlign) public: enum LocationType{Band,Page}; +#if (QT_VERSION >= QT_VERSION_CHECK(5,5, 0)) Q_ENUM(LocationType) +#else + Q_ENUMS(LocationType) +#endif ItemDesignIntf(const QString& xmlTypeName, QObject* owner = 0,QGraphicsItem* parent = 0); LocationType itemLocation(){return m_itemLocation;} void setItemLocation(LocationType location); diff --git a/limereport/lrpageitemdesignintf.h b/limereport/lrpageitemdesignintf.h index dfc865b..3d968d1 100644 --- a/limereport/lrpageitemdesignintf.h +++ b/limereport/lrpageitemdesignintf.h @@ -64,9 +64,9 @@ class PageItemDesignIntf : public ItemsContainerDesignInft friend class ReportRender; public: enum Orientation { Portrait = QPrinter::Portrait, Landscape = QPrinter::Landscape }; - Q_ENUM(Orientation) + enum PrintBehavior {Scale, Split}; - Q_ENUM(PrintBehavior) + enum PageSize { A4 = QPrinter::A4, B5 = QPrinter::B5, Letter = QPrinter::Letter, Legal = QPrinter::Legal, Executive = QPrinter::Executive, @@ -79,7 +79,15 @@ public: Ledger = QPrinter::Ledger, Tabloid = QPrinter::Tabloid, Custom = QPrinter::Custom, NPageSize = Custom }; +#if (QT_VERSION >= QT_VERSION_CHECK(5,5, 0)) + Q_ENUM(Orientation) + Q_ENUM(PrintBehavior) Q_ENUM(PageSize) +#else + Q_ENUMS(Orientation) + Q_ENUMS(PrintBehavior) + Q_ENUMS(PageSize) +#endif typedef QList BandsList; typedef QList::const_iterator BandsIterator; typedef QSharedPointer Ptr; From 02899c10b9e3d50d47ad20f3b294e9ee2e1b1593 Mon Sep 17 00:00:00 2001 From: HatEmU Date: Tue, 3 Mar 2020 03:19:59 +0100 Subject: [PATCH 3/3] Typos and errors --- include/lrglobal.h | 5 +++++ limereport/items/lrabstractlayout.h | 5 +++++ limereport/items/lrchartitem.h | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/lrglobal.h b/include/lrglobal.h index c647294..298e0d8 100644 --- a/include/lrglobal.h +++ b/include/lrglobal.h @@ -33,6 +33,7 @@ #include #include #include +#include #if defined(LIMEREPORT_EXPORTS) # define LIMEREPORT_EXPORT Q_DECL_EXPORT @@ -157,7 +158,11 @@ namespace Const{ { public: enum VariableDataType {Undefined, String, Bool, Int, Real, Date, Time, DateTime}; +#if (QT_VERSION >= QT_VERSION_CHECK(5,5, 0)) Q_ENUM(VariableDataType) +#else + Q_ENUMS(VariableDataType) +#endif private: Enums(){} Q_GADGET diff --git a/limereport/items/lrabstractlayout.h b/limereport/items/lrabstractlayout.h index e4c5010..14ec715 100644 --- a/limereport/items/lrabstractlayout.h +++ b/limereport/items/lrabstractlayout.h @@ -3,6 +3,7 @@ #include "lritemdesignintf.h" #include "lrlayoutmarker.h" +#include namespace LimeReport{ class AbstractLayout: public LayoutDesignIntf @@ -12,7 +13,11 @@ class AbstractLayout: public LayoutDesignIntf Q_PROPERTY(int layoutSpacing READ layoutSpacing WRITE setLayoutSpacing) public: enum LayoutType{Layout,Table}; +#if (QT_VERSION >= QT_VERSION_CHECK(5,5, 0)) Q_ENUM(LayoutType) +#else + Q_ENUMS(LayoutType) +#endif AbstractLayout(QString xmlTag, QObject *owner = 0, QGraphicsItem *parent = 0); ~AbstractLayout(); QList& layoutsChildren(); diff --git a/limereport/items/lrchartitem.h b/limereport/items/lrchartitem.h index b2cd881..2197b8d 100644 --- a/limereport/items/lrchartitem.h +++ b/limereport/items/lrchartitem.h @@ -36,7 +36,7 @@ public: #if (QT_VERSION >= QT_VERSION_CHECK(5,5, 0)) Q_ENUM(SeriesItemPreferredType) #else - Q_ENUM(SeriesItemPreferredType) + Q_ENUMS(SeriesItemPreferredType) #endif SeriesItem(QObject* parent = 0) : QObject(parent), m_preferredType(Bar){} QString name() const;