Remove elementLocation and use elementsLocation instead

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4377 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2016-03-15 15:23:11 +00:00
parent 764d50c4ac
commit 1170522d9c
28 changed files with 626 additions and 924 deletions

View File

@@ -90,50 +90,6 @@ CustomElement::CustomElement(const ElementsLocation &location, QGraphicsItem *qg
elmt_state = 0;
}
/**
* @brief CustomElement::CustomElement
* Constructor build an element from the location @location
* @param location : location of the element
* @param parent : parent of element
* @param state : pointeur used to know the encountered error at creation...
- 0 : No error
- 1 : The location don't represent an element
- 2 : The location can't be readable
- 3 : The location isn't valid / exploitable / usable
- 4 : The xml document wasn't an element "definition"
- 5 : The attributes of the defintion aren't present and/or valid
- 6 : The defintion is empty
- 7 : The analyze of an xml element that describe a part of the drawing was failed
- 8 : No part of the drawing can be loaded
*/
CustomElement::CustomElement(ElementLocation &location, QGraphicsItem *parent, int *state) :
FixedElement(parent),
elmt_state(-1),
m_location(location),
forbid_antialiasing(false)
{
if (!location.isElement())
{
if (state) *state = 1;
elmt_state = 1;
}
//Start from empty lists.
list_lines_.clear();
list_rectangles_.clear();
list_circles_.clear();
list_polygons_.clear();
list_arcs_.clear();
buildFromXml(location.xml(), &elmt_state);
if (state) *state = elmt_state;
if (elmt_state) return;
if (state) *state = 0;
elmt_state = 0;
}
/**
Construit l'element personnalise a partir d'un element XML representant sa
definition.

View File

@@ -20,7 +20,6 @@
#include "fixedelement.h"
#include "nameslist.h"
#include "elementslocation.h"
#include "elementlocation.h"
#include <QPicture>
class ElementTextItem;
@@ -38,7 +37,6 @@ class CustomElement : public FixedElement
// constructors, destructor
public:
CustomElement (const ElementsLocation &, QGraphicsItem * = 0, int * = 0);
CustomElement (ElementLocation &location, QGraphicsItem *parent = nullptr, int *state = nullptr);
virtual ~CustomElement();
@@ -50,7 +48,6 @@ class CustomElement : public FixedElement
int elmt_state; // hold the error code in case the instanciation fails, or 0 if everything went well
NamesList names;
ElementsLocation location_;
ElementLocation m_location;
QPicture drawing;
QPicture low_zoom_drawing;
QList<Terminal *> list_terminals;

View File

@@ -35,14 +35,6 @@ MasterElement::MasterElement(const ElementsLocation &location, QGraphicsItem *qg
connect(this, SIGNAL(elementInfoChange(DiagramContext, DiagramContext)), this, SLOT(updateLabel(DiagramContext, DiagramContext)));
}
MasterElement::MasterElement(ElementLocation &location, QGraphicsItem *parent, int *state) :
CustomElement(location, parent, state),
cri_ (nullptr)
{
link_type_ = Master;
connect(this, SIGNAL(elementInfoChange(DiagramContext, DiagramContext)), this, SLOT(updateLabel(DiagramContext, DiagramContext)));
}
/**
* @brief MasterElement::~MasterElement
* default destructor

View File

@@ -34,7 +34,6 @@ class MasterElement : public CustomElement
public:
explicit MasterElement(const ElementsLocation &, QGraphicsItem * = 0, int * = 0);
explicit MasterElement(ElementLocation &location, QGraphicsItem *parent = nullptr, int *state = nullptr);
~MasterElement();
virtual void linkToElement (Element *elmt);

View File

@@ -51,34 +51,6 @@ ReportElement::ReportElement(const ElementsLocation &location, QString link_type
}
}
ReportElement::ReportElement(ElementLocation &location, QString link_type, QGraphicsItem *parent, int *state) :
CustomElement(location, parent, state),
m_text_field (nullptr),
m_watched_conductor (nullptr)
{
/*
* Get text tagged label. This is work for report
* create after the revision 3559.
* for report create before, we take the first text field
* because report haven't got a text field tagged label
*/
m_text_field = taggedText("label");
if (!m_text_field && !texts().isEmpty())
m_text_field = texts().first();
if (m_text_field)
m_text_field -> setNoEditable();
link_type == "next_report"? link_type_=NextReport : link_type_=PreviousReport;
link_type == "next_report"? inverse_report=PreviousReport : inverse_report=NextReport;
//We make these connections, to be always aware about the conductor properties
if (terminals().size())
{
connect (terminals().first(), &Terminal::conductorWasAdded, this, &ReportElement::conductorWasAdded);
connect (terminals().first(), &Terminal::conductorWasRemoved, this, &ReportElement::conductorWasRemoved);
}
}
/**
* @brief ReportElement::~ReportElement
* Destructor

View File

@@ -33,7 +33,6 @@ class ReportElement : public CustomElement
public :
explicit ReportElement(const ElementsLocation &,QString link_type, QGraphicsItem * = 0, int * = 0);
explicit ReportElement(ElementLocation &location, QString link_type, QGraphicsItem *parent = nullptr, int *state = nullptr);
~ReportElement();
virtual void linkToElement(Element *);
virtual void unlinkAllElements();

View File

@@ -33,14 +33,6 @@ SimpleElement::SimpleElement(const ElementsLocation &location, QGraphicsItem *qg
connect(this, SIGNAL(elementInfoChange(DiagramContext, DiagramContext)), this, SLOT(updateLabel(DiagramContext, DiagramContext)));
}
SimpleElement::SimpleElement(ElementLocation &location, QGraphicsItem *parent, int *state) :
CustomElement(location, parent, state),
m_comment_item (nullptr)
{
link_type_ = Simple;
connect(this, SIGNAL(elementInfoChange(DiagramContext, DiagramContext)), this, SLOT(updateLabel(DiagramContext, DiagramContext)));
}
/**
* @brief SimpleElement::~SimpleElement
*/

View File

@@ -33,7 +33,6 @@ class SimpleElement : public CustomElement {
public :
explicit SimpleElement(const ElementsLocation &, QGraphicsItem * = 0, int * = 0);
explicit SimpleElement(ElementLocation &location, QGraphicsItem *parent = nullptr, int *state = nullptr);
~SimpleElement();
virtual void initLink(QETProject *project);

View File

@@ -36,13 +36,6 @@ SlaveElement::SlaveElement(const ElementsLocation &location, QGraphicsItem *qgi,
link_type_ = Slave;
}
SlaveElement::SlaveElement(ElementLocation &location, QGraphicsItem *parent, int *state) :
CustomElement(location, parent, state)
{
Xref_item = nullptr;
link_type_ = Slave;
}
/**
* @brief SlaveElement::~SlaveElement
* default destructor

View File

@@ -25,7 +25,6 @@ class SlaveElement : public CustomElement
Q_OBJECT
public:
explicit SlaveElement (const ElementsLocation &, QGraphicsItem * = 0, int * = 0);
explicit SlaveElement(ElementLocation &location, QGraphicsItem *parent = nullptr, int *state = nullptr);
~SlaveElement();
virtual void linkToElement(Element *elmt);
virtual void unlinkAllElements();

View File

@@ -31,10 +31,4 @@ TerminalElement::TerminalElement(const ElementsLocation &location, QGraphicsItem
link_type_ = Terminale;
}
TerminalElement::TerminalElement(ElementLocation &location, QGraphicsItem *parent, int *state) :
CustomElement(location, parent, state)
{
link_type_ = Terminale;
}
TerminalElement::~TerminalElement() {}

View File

@@ -25,7 +25,6 @@ class TerminalElement : public CustomElement
Q_OBJECT
public:
TerminalElement(const ElementsLocation &, QGraphicsItem * = 0, int * = 0);
TerminalElement (ElementLocation &location, QGraphicsItem *parent = nullptr, int *state = nullptr);
~TerminalElement();
};