mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-02-20 19:19:58 +01:00
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:
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -22,5 +22,5 @@ ReportElement::ReportElement(const ElementsLocation &location, QGraphicsItem *qg
|
||||
{}
|
||||
|
||||
int ReportElement::linkType() const {
|
||||
return ReportElement::report;
|
||||
return REPORT;
|
||||
}
|
||||
|
||||
@@ -22,5 +22,5 @@ SimpleElement::SimpleElement(const ElementsLocation &location, QGraphicsItem *qg
|
||||
{}
|
||||
|
||||
int SimpleElement::linkType() const {
|
||||
return SimpleElement::simple;
|
||||
return SIMPLE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user