Element : edit an element text item (with tagg) directly on the folio, also update the information of the element.

For exemple, edit the element text item tagged "label", update the value with key "label" of element information. 


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4804 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2016-12-08 16:54:41 +00:00
parent 9f014d55af
commit ae2afe8424
5 changed files with 72 additions and 102 deletions

View File

@@ -28,6 +28,7 @@ class QETProject;
class Terminal;
class Conductor;
class NumerotationContext;
class DiagramTextItem;
/**
This is the base class for electrical elements.
@@ -46,8 +47,7 @@ class Element : public QetGraphicsItem
// attributes
public:
/**
* Enable the use of qgraphicsitem_cast to safely cast
* a QGraphicsItem into an Element.
* Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into an Element.
* @return the QGraphicsItem type
*/
enum { Type = UserType + 1000 };
@@ -72,30 +72,30 @@ class Element : public QetGraphicsItem
// methods
public:
/// @return the list of terminals for this element
virtual QList<Terminal *> terminals() const = 0;
/// @return the list of conductors attached to this element
virtual QList<Conductor *> conductors() const = 0;
/// @return the list of text items attached to this element
virtual QList<ElementTextItem *> texts() const = 0;
/// @return the text field tagged with @tagg or NULL if text field isn't found
virtual ElementTextItem* taggedText(const QString &tagg) const = 0;
/// @return the list of lines items in this element
virtual QList<QLineF *> lines() const = 0;
/// @return the list of rectangles items in this element
virtual QList<QRectF *> rectangles() const = 0;
/// @return the list of bounding rectangles for circles items in this element
virtual QList<QRectF *> circles() const = 0;
/// @return the list of polygons in this element
virtual QList<QVector<QPointF> *> polygons() const = 0;
/// @return the list of arcs in this element
virtual QList<QVector<qreal> *> arcs() const = 0;
/// @return the current number of terminals of this element
virtual int terminalsCount() const = 0;
/// @return the minimum number of terminals for this element
virtual int minTerminalsCount() const = 0;
/// @return the maximum number of terminals for this element
virtual int maxTerminalsCount() const = 0;
/// @return the list of terminals for this element
virtual QList<Terminal *> terminals() const = 0;
/// @return the list of conductors attached to this element
virtual QList<Conductor *> conductors() const = 0;
/// @return the list of text items attached to this element
virtual QList<ElementTextItem *> texts() const = 0;
/// @return the text field tagged with @tagg or NULL if text field isn't found
virtual ElementTextItem* taggedText(const QString &tagg) const = 0;
/// @return the list of lines items in this element
virtual QList<QLineF *> lines() const = 0;
/// @return the list of rectangles items in this element
virtual QList<QRectF *> rectangles() const = 0;
/// @return the list of bounding rectangles for circles items in this element
virtual QList<QRectF *> circles() const = 0;
/// @return the list of polygons in this element
virtual QList<QVector<QPointF> *> polygons() const = 0;
/// @return the list of arcs in this element
virtual QList<QVector<qreal> *> arcs() const = 0;
/// @return the current number of terminals of this element
virtual int terminalsCount() const = 0;
/// @return the minimum number of terminals for this element
virtual int minTerminalsCount() const = 0;
/// @return the maximum number of terminals for this element
virtual int maxTerminalsCount() const = 0;
QList <QPair <Terminal *, Terminal *> > AlignedFreeTerminals () const;
@@ -130,6 +130,7 @@ class Element : public QetGraphicsItem
//METHODS related to information
public:
void textItemChanged(DiagramTextItem *dti, QString old_str, QString new_str);
DiagramContext elementInformations ()const {return m_element_informations;}
DiagramContext& rElementInformations () {return m_element_informations;}
virtual void setElementInformations (DiagramContext dc);