element class: replace enum linkertype by #define (better way for use flags)

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2675 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2013-12-29 13:27:46 +00:00
parent 0d37b13dab
commit 5eecfedd02
8 changed files with 26 additions and 24 deletions

View File

@@ -22,21 +22,21 @@
#include "qetgraphicsitem.h"
class Diagram;
class ElementTextItem;
// this define is use to know the kind of element and
// to use flag for element provider class
#define SIMPLE 1
#define REPORT 2
#define MASTER 4
#define SLAVE 8
#define BORNIER 16
/**
This is the base class for electrical elements.
*/
class Element : public QetGraphicsItem {
Q_OBJECT
public:
enum linkerType{
simple = 1,
report = 2,
master = 4,
slave = 8,
bornier = 16
};
// constructors, destructor
public:

View File

@@ -43,7 +43,7 @@ class GhostElement : public CustomElement {
// methods
public:
virtual bool fromXml(QDomElement &, QHash<int, Terminal *> &, bool = false);
virtual int linkType() const {return Element::simple;}
virtual int linkType() const {return SIMPLE;}
protected:
QRectF minimalBoundingRect() const;

View File

@@ -22,5 +22,5 @@ ReportElement::ReportElement(const ElementsLocation &location, QGraphicsItem *qg
{}
int ReportElement::linkType() const {
return ReportElement::report;
return REPORT;
}

View File

@@ -22,5 +22,5 @@ SimpleElement::SimpleElement(const ElementsLocation &location, QGraphicsItem *qg
{}
int SimpleElement::linkType() const {
return SimpleElement::simple;
return SIMPLE;
}