From 1ac950cd8174738829ab7b6442a94398e1a9da2a Mon Sep 17 00:00:00 2001 From: blacksun Date: Mon, 18 Mar 2019 19:49:12 +0000 Subject: [PATCH] Replace Q_ENUMS (with S, deprecated since Qt5.5) by Q_ENUM (without S) git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5800 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- .../graphicspart/customelementgraphicpart.h | 12 ++-- sources/qet.h | 56 ++++++++++--------- .../qetgraphicsitem/dynamicelementtextitem.h | 3 +- sources/qetgraphicsitem/qetshapeitem.h | 2 +- 4 files changed, 38 insertions(+), 35 deletions(-) diff --git a/sources/editor/graphicspart/customelementgraphicpart.h b/sources/editor/graphicspart/customelementgraphicpart.h index e109588b0..077c53452 100644 --- a/sources/editor/graphicspart/customelementgraphicpart.h +++ b/sources/editor/graphicspart/customelementgraphicpart.h @@ -36,12 +36,6 @@ class CustomElementGraphicPart : public QGraphicsObject, public CustomElementPar Q_OBJECT - //Made this Q_ENUMS to be used by the Q_PROPERTY system. - Q_ENUMS (LineStyle) - Q_ENUMS (LineWeight) - Q_ENUMS (Filling) - Q_ENUMS (Color) - Q_PROPERTY(LineStyle line_style READ lineStyle WRITE setLineStyle) Q_PROPERTY(LineWeight line_weight READ lineWeight WRITE setLineWeight) Q_PROPERTY(Filling filling READ filling WRITE setFilling) @@ -51,16 +45,20 @@ class CustomElementGraphicPart : public QGraphicsObject, public CustomElementPar public: //Line style enum LineStyle {NormalStyle, DashedStyle, DottedStyle, DashdottedStyle}; + Q_ENUM (LineStyle) //Line weight : invisible, 0px, 1px, 2px, 5px enum LineWeight {NoneWeight, ThinWeight, NormalWeight, UltraWeight, BigWeight}; + Q_ENUM (LineWeight) //Filling color of the part : NoneFilling -> No filling (i.e. transparent) enum Filling { NoneFilling, BlackFilling, WhiteFilling, GreenFilling, RedFilling, BlueFilling, GrayFilling, BrunFilling, YellowFilling, CyanFilling, MagentaFilling, LightgrayFilling, OrangeFilling, PurpleFilling, HorFilling, VerFilling, BdiagFilling, FdiagFilling}; + Q_ENUM (Filling) //Line color enum Color {BlackColor, WhiteColor, GreenColor, RedColor, BlueColor, GrayColor, BrunColor, YellowColor, CyanColor, MagentaColor, LightgrayColor, OrangeColor, PurpleColor, NoneColor}; - + Q_ENUM (Color) + // constructors, destructor public: diff --git a/sources/qet.h b/sources/qet.h index 43a8d0cf8..500a892d3 100644 --- a/sources/qet.h +++ b/sources/qet.h @@ -182,37 +182,41 @@ namespace QET { Q_DECLARE_METATYPE(QET::DepthOption) -class Qet : public QObject { +class Qet : public QObject +{ Q_OBJECT + public: - ///This enum lists the various available endings for line primitives when drawing an electrical element. - Q_ENUMS(EndType) - enum EndType { - None, ///< Regular line - Simple, ///< Base-less triangle - Triangle, ///< Triangle - Circle, ///< Circle - Diamond ///< Diamond - }; - static QString endTypeToString(const Qet::EndType &); - static Qet::EndType endTypeFromString(const QString &); + ///This enum lists the various available endings for line primitives when drawing an electrical element. + enum EndType { + None, ///< Regular line + Simple, ///< Base-less triangle + Triangle, ///< Triangle + Circle, ///< Circle + Diamond ///< Diamond + }; + Q_ENUM (EndType) - /// Orientation (used for electrical elements and their terminals) - Q_ENUMS(Orientation) - enum Orientation {North, - East, - South, - West}; - static Qet::Orientation nextOrientation(Qet::Orientation); - static Qet::Orientation previousOrientation(Qet::Orientation); + static QString endTypeToString(const Qet::EndType &); + static Qet::EndType endTypeFromString(const QString &); - static Qet::Orientation orientationFromString (const QString &); - static QString orientationToString (Qet::Orientation); + /// Orientation (used for electrical elements and their terminals) + enum Orientation {North, + East, + South, + West}; + Q_ENUM (Orientation) - static bool surLeMemeAxe (Qet::Orientation, Qet::Orientation); - static bool isOpposed (Qet::Orientation a, Qet::Orientation b); - static bool isHorizontal (Qet::Orientation); - static bool isVertical (Qet::Orientation); + static Qet::Orientation nextOrientation(Qet::Orientation); + static Qet::Orientation previousOrientation(Qet::Orientation); + + static Qet::Orientation orientationFromString (const QString &); + static QString orientationToString (Qet::Orientation); + + static bool surLeMemeAxe (Qet::Orientation, Qet::Orientation); + static bool isOpposed (Qet::Orientation a, Qet::Orientation b); + static bool isHorizontal (Qet::Orientation); + static bool isVertical (Qet::Orientation); }; #endif diff --git a/sources/qetgraphicsitem/dynamicelementtextitem.h b/sources/qetgraphicsitem/dynamicelementtextitem.h index 5cc093385..c7acd82f2 100644 --- a/sources/qetgraphicsitem/dynamicelementtextitem.h +++ b/sources/qetgraphicsitem/dynamicelementtextitem.h @@ -50,12 +50,13 @@ class DynamicElementTextItem : public DiagramTextItem Q_PROPERTY(qreal textWidth READ textWidth WRITE setTextWidth NOTIFY textWidthChanged) public: - Q_ENUMS(TextFrom) + enum TextFrom { UserText, ElementInfo, CompositeText }; + Q_ENUM (TextFrom) enum {Type = UserType + 1010}; int type() const override {return Type;} diff --git a/sources/qetgraphicsitem/qetshapeitem.h b/sources/qetgraphicsitem/qetshapeitem.h index 2104f5c1f..d8de02055 100644 --- a/sources/qetgraphicsitem/qetshapeitem.h +++ b/sources/qetgraphicsitem/qetshapeitem.h @@ -54,11 +54,11 @@ class QetShapeItem : public QetGraphicsItem public: - Q_ENUMS(ShapeType) enum ShapeType {Line =1, Rectangle =2, Ellipse =4, Polygon =8 }; + Q_ENUM (ShapeType) enum { Type = UserType + 1008 };