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
This commit is contained in:
blacksun 2019-03-18 19:49:12 +00:00
parent 07da381515
commit 1ac950cd81
4 changed files with 38 additions and 35 deletions

View File

@ -36,12 +36,6 @@ class CustomElementGraphicPart : public QGraphicsObject, public CustomElementPar
Q_OBJECT 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(LineStyle line_style READ lineStyle WRITE setLineStyle)
Q_PROPERTY(LineWeight line_weight READ lineWeight WRITE setLineWeight) Q_PROPERTY(LineWeight line_weight READ lineWeight WRITE setLineWeight)
Q_PROPERTY(Filling filling READ filling WRITE setFilling) Q_PROPERTY(Filling filling READ filling WRITE setFilling)
@ -51,15 +45,19 @@ class CustomElementGraphicPart : public QGraphicsObject, public CustomElementPar
public: public:
//Line style //Line style
enum LineStyle {NormalStyle, DashedStyle, DottedStyle, DashdottedStyle}; enum LineStyle {NormalStyle, DashedStyle, DottedStyle, DashdottedStyle};
Q_ENUM (LineStyle)
//Line weight : invisible, 0px, 1px, 2px, 5px //Line weight : invisible, 0px, 1px, 2px, 5px
enum LineWeight {NoneWeight, ThinWeight, NormalWeight, UltraWeight, BigWeight}; enum LineWeight {NoneWeight, ThinWeight, NormalWeight, UltraWeight, BigWeight};
Q_ENUM (LineWeight)
//Filling color of the part : NoneFilling -> No filling (i.e. transparent) //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}; 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 //Line color
enum Color {BlackColor, WhiteColor, GreenColor, RedColor, BlueColor, GrayColor, BrunColor, YellowColor, CyanColor, MagentaColor, LightgrayColor, OrangeColor, PurpleColor, NoneColor}; enum Color {BlackColor, WhiteColor, GreenColor, RedColor, BlueColor, GrayColor, BrunColor, YellowColor, CyanColor, MagentaColor, LightgrayColor, OrangeColor, PurpleColor, NoneColor};
Q_ENUM (Color)
// constructors, destructor // constructors, destructor
public: public:

View File

@ -182,11 +182,12 @@ namespace QET {
Q_DECLARE_METATYPE(QET::DepthOption) Q_DECLARE_METATYPE(QET::DepthOption)
class Qet : public QObject { class Qet : public QObject
{
Q_OBJECT Q_OBJECT
public: public:
///This enum lists the various available endings for line primitives when drawing an electrical element. ///This enum lists the various available endings for line primitives when drawing an electrical element.
Q_ENUMS(EndType)
enum EndType { enum EndType {
None, ///< Regular line None, ///< Regular line
Simple, ///< Base-less triangle Simple, ///< Base-less triangle
@ -194,15 +195,18 @@ class Qet : public QObject {
Circle, ///< Circle Circle, ///< Circle
Diamond ///< Diamond Diamond ///< Diamond
}; };
Q_ENUM (EndType)
static QString endTypeToString(const Qet::EndType &); static QString endTypeToString(const Qet::EndType &);
static Qet::EndType endTypeFromString(const QString &); static Qet::EndType endTypeFromString(const QString &);
/// Orientation (used for electrical elements and their terminals) /// Orientation (used for electrical elements and their terminals)
Q_ENUMS(Orientation)
enum Orientation {North, enum Orientation {North,
East, East,
South, South,
West}; West};
Q_ENUM (Orientation)
static Qet::Orientation nextOrientation(Qet::Orientation); static Qet::Orientation nextOrientation(Qet::Orientation);
static Qet::Orientation previousOrientation(Qet::Orientation); static Qet::Orientation previousOrientation(Qet::Orientation);

View File

@ -50,12 +50,13 @@ class DynamicElementTextItem : public DiagramTextItem
Q_PROPERTY(qreal textWidth READ textWidth WRITE setTextWidth NOTIFY textWidthChanged) Q_PROPERTY(qreal textWidth READ textWidth WRITE setTextWidth NOTIFY textWidthChanged)
public: public:
Q_ENUMS(TextFrom)
enum TextFrom { enum TextFrom {
UserText, UserText,
ElementInfo, ElementInfo,
CompositeText CompositeText
}; };
Q_ENUM (TextFrom)
enum {Type = UserType + 1010}; enum {Type = UserType + 1010};
int type() const override {return Type;} int type() const override {return Type;}

View File

@ -54,11 +54,11 @@ class QetShapeItem : public QetGraphicsItem
public: public:
Q_ENUMS(ShapeType)
enum ShapeType {Line =1, enum ShapeType {Line =1,
Rectangle =2, Rectangle =2,
Ellipse =4, Ellipse =4,
Polygon =8 }; Polygon =8 };
Q_ENUM (ShapeType)
enum { Type = UserType + 1008 }; enum { Type = UserType + 1008 };