QElectroTech  0.8-dev
element.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef ELEMENT_H
19 #define ELEMENT_H
20 
21 #include "qet.h"
22 #include "qetgraphicsitem.h"
23 #include "diagramcontext.h"
24 #include "assignvariables.h"
25 #include "elementslocation.h"
26 #include "nameslist.h"
27 
28 #include <algorithm>
29 #include <QPicture>
30 
31 class QETProject;
32 class Terminal;
33 class Conductor;
36 
40 class Element : public QetGraphicsItem
41 {
42  friend class DiagramEventAddElement;
43 
44  Q_OBJECT
45  public:
51  enum kind {Simple = 1,
54  AllReport = 6,
55  Master = 8,
56  Slave = 16,
57  Terminale = 32};
58 
60  QGraphicsItem * = nullptr,
61  int *state = nullptr,
62  Element::kind link_type = Element::Simple);
63  ~Element() override;
64  private:
65  Element(const Element &);
66 
67  // attributes
68  public:
74  enum { Type = UserType + 1000 };
75  int type() const override { return Type; }
76 
77  signals:
78  void linkedElementChanged(); //This signal is emited when the linked elements with this element change
80  DiagramContext new_info);
86  ElementTextItemGroup *group);
88  ElementTextItemGroup *group);
89 
90 
91  public:
92  QList<Terminal *> terminals() const;
93  QList<Conductor *> conductors() const;
94  QList<QPair<Terminal *,Terminal *>> AlignedFreeTerminals() const;
95 
96  //METHODS related to information
98  {return m_element_informations;}
99  virtual void setElementInformations(DiagramContext dc);
101  {return m_kind_informations;}
102  //@kind_information_ is used to store more information
103  //about the herited class like contactelement for know
104  // kind of contact (simple tempo) or number of contact show by the element.
105 
107  {return m_autoNum_seq;}
109  {return m_autoNum_seq;}
110  void setUpFormula(bool code_letter = true);
111  void setPrefix(QString);
112  QString getPrefix() const;
113  void freezeLabel(bool freeze);
114  bool isFreezeLabel() const {return m_freeze_label;}
115  void freezeNewAddedElement();
116  QString actualLabel();
117 
118  QString name() const override;
119  ElementsLocation location() const;
120  virtual void setHighlighted(bool);
121  void displayHelpLine(bool b = true);
122  QSize size() const;
123  QPixmap pixmap();
124  QPoint setHotspot(QPoint);
125  QPoint hotspot() const;
126  void editProperty() override;
127  static bool valideXml(QDomElement &);
128  virtual bool fromXml(QDomElement &,
129  QHash<int,
130  Terminal *> &,
131  bool = false);
132  virtual QDomElement toXml(QDomDocument &,
133  QHash<Terminal *,
134  int> &) const;
135  QUuid uuid() const;
136  int orientation() const;
137 
138  //METHODS related to texts
139  void addDynamicTextItem(DynamicElementTextItem *deti = nullptr);
141  QList<DynamicElementTextItem *> dynamicTextItems() const;
142  ElementTextItemGroup *addTextGroup(const QString &name);
143  void addTextGroup(ElementTextItemGroup *group);
145  ElementTextItemGroup *textGroup(const QString &name) const;
146  QList<ElementTextItemGroup *> textGroups() const;
148  ElementTextItemGroup *group);
150  ElementTextItemGroup *group);
151 
152  //METHODS related to linked element
153  bool isFree() const;
154  virtual void linkToElement(Element *) {}
155  virtual void unlinkAllElements() {}
156  virtual void unlinkElement(Element *) {}
157  virtual void initLink(QETProject *);
158  QList<Element *> linkedElements ();
159  virtual kind linkType() const {return m_link_type;} // return the linkable type
160  QString linkTypeToString() const;
161  void newUuid() {m_uuid = QUuid::createUuid();} //create new uuid for this element
162 
163  protected:
164  void drawAxes(QPainter *, const QStyleOptionGraphicsItem *);
165  void setSize(int, int);
166 
167  private:
168  void drawSelection(QPainter *,
169  const QStyleOptionGraphicsItem *);
170  void drawHighlight(QPainter *,
171  const QStyleOptionGraphicsItem *);
172  bool buildFromXml(const QDomElement &, int * = nullptr);
173  bool parseElement(const QDomElement &dom);
174  bool parseInput(const QDomElement &dom_element);
176  const QDomElement &dom_element);
177  Terminal *parseTerminal(const QDomElement &dom_element);
178 
179  //Reimplemented from QGraphicsItem
180  public:
181  void paint(QPainter *,
182  const QStyleOptionGraphicsItem *,
183  QWidget *) override;
184  QRectF boundingRect() const override;
185  protected:
186  void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
187  void mouseReleaseEvent(
188  QGraphicsSceneMouseEvent *event) override;
189  void hoverEnterEvent(QGraphicsSceneHoverEvent *) override;
190  void hoverLeaveEvent(QGraphicsSceneHoverEvent *) override;
191 
192  protected:
193  // m_converted_text_from_description, when a element is created from his description, the old element text item (tagged as 'input' in the xml)
194  // are converted to dynamic text field, the QPointF is the original position of the text item, because the origin transformation point of text item
195  // and dynamic text item are not the same, so we must to keep a track of this value, to be use in the function element::fromXml
196  QHash <DynamicElementTextItem *, QPointF>
198 
199  //ATTRIBUTES related to linked element
200  QList <Element *> connected_elements;
201  QList <QUuid> tmp_uuids_link;
202  QUuid m_uuid;
204 
205  //ATTRIBUTES related to informations
208  bool m_freeze_label = false;
209  QString m_F_str;
210 
213  QList <Terminal *> m_terminals;
214  const QPicture m_picture;
215  const QPicture m_low_zoom_picture;
216 
217  private:
218  bool m_must_highlight = false;
219  QSize dimensions;
221  bool m_mouse_over = false;
222  QString m_prefix;
223  QList <DynamicElementTextItem *> m_dynamic_text_list;
224  QList <ElementTextItemGroup *> m_texts_group;
225 
226 };
227 
228 bool comparPos(const Element * elmt1, const Element * elmt2);
229 
230 inline bool Element::isFree() const {
231  return (connected_elements.isEmpty());
232 }
233 
242 inline int Element::orientation() const {
243  return(QET::correctAngle(rotation())/90);
244 }
245 
250 inline QUuid Element::uuid() const {
251  return m_uuid;
252 }
253 
258 inline QList <Element *> Element::linkedElements() {
259  std::sort(connected_elements.begin(),
260  connected_elements.end(),
261  comparPos);
262  return connected_elements;
263 }
264 
265 #endif
ElementsLocation::exist
bool exist() const
ElementsLocation::exist.
Definition: elementslocation.cpp:472
Element::Terminale
@ Terminale
Definition: element.h:57
Element::tmp_uuids_link
QList< QUuid > tmp_uuids_link
Definition: element.h:201
Terminal::valideXml
static bool valideXml(QDomElement &)
Terminal::valideXml Permet de savoir si un element XML represente une borne.
Definition: terminal.cpp:746
Element::setSize
void setSize(int, int)
Element::setSize Define the size of the element. The size must be a multiple of 10....
Definition: element.cpp:235
Element::size
QSize size() const
Definition: element.cpp:247
Terminal::conductors
QList< Conductor * > conductors() const
Terminal::conductors.
Definition: terminal.cpp:715
Element::parseInput
bool parseInput(const QDomElement &dom_element)
Element::parseInput Parse the input (old text field) the parsed input are converted to dynamic text f...
Definition: element.cpp:542
DiagramContext::keys
QList< QString > keys(KeyOrder=None) const
Definition: diagramcontext.cpp:49
Element::linkType
virtual kind linkType() const
Definition: element.h:159
Element::m_texts_group
QList< ElementTextItemGroup * > m_texts_group
Definition: element.h:224
Element::m_prefix
QString m_prefix
Definition: element.h:222
QETProject::addElementAutoNum
void addElementAutoNum(const QString &key, const NumerotationContext &context)
QETProject::addElementAutoNum Add a new element numerotation context. If key already exist,...
Definition: qetproject.cpp:598
Element::hotspot
QPoint hotspot() const
Definition: element.cpp:272
Element::parseElement
bool parseElement(const QDomElement &dom)
Element::parseElement Parse the element of the xml description of this element.
Definition: element.cpp:526
Element::m_kind_informations
DiagramContext m_kind_informations
Definition: element.h:206
Element::buildFromXml
bool buildFromXml(const QDomElement &, int *=nullptr)
Element::buildFromXml Build this element from an xml description.
Definition: element.cpp:376
Element::~Element
~Element() override
Element::~Element.
Definition: element.cpp:126
Element::m_picture
const QPicture m_picture
Definition: element.h:214
Element::addTextToGroup
bool addTextToGroup(DynamicElementTextItem *text, ElementTextItemGroup *group)
Element::addTextToGroup Add the text text to the group group; If group isn't owned by this element re...
Definition: element.cpp:1432
DynamicElementTextItem
The DynamicElementTextItem class This class provide a simple text field of element who can be added o...
Definition: dynamicelementtextitem.h:39
QetGraphicsItem
Definition: qetgraphicsitem.h:27
qetgraphicsitem.h
propertieseditordialog.h
DiagramContext::fromXml
void fromXml(const QDomElement &, const QString &="property")
Definition: diagramcontext.cpp:157
diagramcommands.h
autonum::sequentialNumbers
Definition: assignvariables.h:35
autonum::sequentialNumbers::clear
void clear()
Definition: assignvariables.cpp:165
nameslist.h
Element::m_converted_text_from_xml_description
QHash< DynamicElementTextItem *, QPointF > m_converted_text_from_xml_description
Definition: element.h:197
Element::linkedElements
QList< Element * > linkedElements()
Element::linkedElements.
Definition: element.h:258
Element::m_element_informations
DiagramContext m_element_informations
Definition: element.h:206
autonum::sequentialNumbers::fromXml
void fromXml(const QDomElement &element)
sequentialNumbers::fromXml Import sequential values from a QDomElement
Definition: assignvariables.cpp:138
elementpicturefactory.h
ElementProvider
Definition: elementprovider.h:37
ElementsLocation::path
QString path() const
ElementsLocation::path.
Definition: elementslocation.cpp:206
QetGraphicsItem::mouseReleaseEvent
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
QetGraphicsItem::mouseReleaseEvent handle mouse release click.
Definition: qetgraphicsitem.cpp:149
Element::pixmap
QPixmap pixmap()
Element::pixmap.
Definition: element.cpp:280
Element::elementInformations
DiagramContext elementInformations() const
Definition: element.h:97
QetGraphicsItem::diagram
Diagram * diagram() const
Definition: qetgraphicsitem.cpp:40
conductor.h
Element::uuid
QUuid uuid() const
Element::uuid.
Definition: element.h:250
QET::version
const QString version
QElectroTech version (as string, used to mark projects and elements XML documents)
Definition: qet.h:32
Element::newUuid
void newUuid()
Definition: element.h:161
Element::NextReport
@ NextReport
Definition: element.h:52
Element::linkTypeToString
QString linkTypeToString() const
Definition: element.cpp:1520
ElementTextItemGroup::parentElement
Element * parentElement() const
ElementTextItemGroup::parentElement.
Definition: elementtextitemgroup.cpp:357
ElementXmlRetroCompatibility
Definition: element.cpp:38
diagramposition.h
Element::isFreezeLabel
bool isFreezeLabel() const
Definition: element.h:114
DiagramPosition::letter
QString letter() const
Definition: diagramposition.h:42
DynamicElementTextItem::m_uuid
QUuid m_uuid
Definition: dynamicelementtextitem.h:150
DynamicElementTextItem::xmlTagName
static QString xmlTagName()
Definition: dynamicelementtextitem.h:94
Element::setHighlighted
virtual void setHighlighted(bool)
Definition: element.cpp:178
Element::actualLabel
QString actualLabel()
Element::actualLabel Always return the current label to be displayed. This function is usefull when l...
Definition: element.cpp:1738
elementtextitemgroup.h
ElementTextItemGroup::fromXml
void fromXml(QDomElement &dom_element)
ElementTextItemGroup::fromXml Import data of this group from xml.
Definition: elementtextitemgroup.cpp:405
Element::paint
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override
Element::paint.
Definition: element.cpp:199
DynamicElementTextItem::setFrame
void setFrame(const bool frame)
Definition: dynamicelementtextitem.cpp:506
autonum::sequentialNumbers::unit_folio
QStringList unit_folio
Definition: assignvariables.h:50
NumerotationContextCommands
The NumerotationContextCommands class this class provide methods to handle content of NumerotationCon...
Definition: numerotationcontextcommands.h:31
DiagramEventAddElement
The DiagramEventAddElement class This diagram event add a new element, for each left click button at ...
Definition: diagrameventaddelement.h:32
Element::hoverLeaveEvent
void hoverLeaveEvent(QGraphicsSceneHoverEvent *) override
Definition: element.cpp:1636
Element::textAdded
void textAdded(DynamicElementTextItem *deti)
Element::drawHighlight
void drawHighlight(QPainter *, const QStyleOptionGraphicsItem *)
Definition: element.cpp:337
changeelementinformationcommand.h
Element::linkToElement
virtual void linkToElement(Element *)
Definition: element.h:154
Element::elementInfoChange
void elementInfoChange(DiagramContext old_info, DiagramContext new_info)
Element::linkedElementChanged
void linkedElementChanged()
Element::Simple
@ Simple
Definition: element.h:51
QETProject::elementCurrentAutoNum
QString elementCurrentAutoNum() const
QETProject::elementCurrentAutoNum.
Definition: qetproject.cpp:531
DynamicElementTextItem::fromXml
void fromXml(const QDomElement &dom_elmt) override
DynamicElementTextItem::fromXml Import this text from xml.
Definition: dynamicelementtextitem.cpp:154
ElementTextItemGroup::xmlTaggName
static QString xmlTaggName()
Definition: elementtextitemgroup.h:82
assignvariables.h
Element::Slave
@ Slave
Definition: element.h:56
NumerotationContext
Definition: numerotationcontext.h:31
Element::Type
@ Type
Definition: element.h:74
QET::findInDomElement
QList< QDomElement > findInDomElement(const QDomElement &, const QString &)
Definition: qet.cpp:333
XRefProperties::Label
@ Label
Definition: xrefproperties.h:40
Element::setElementInformations
virtual void setElementInformations(DiagramContext dc)
Element::setElementInformations Set new information for this element. If new information is different...
Definition: element.cpp:1547
Diagram::project
QETProject * project() const
Diagram::project.
Definition: diagram.cpp:2326
Element::orientation
int orientation() const
Definition: element.h:242
Element::addTextGroup
ElementTextItemGroup * addTextGroup(const QString &name)
Element::addTextGroup Create and add an element text item group to this element. If this element alre...
Definition: element.cpp:1328
Element::m_location
ElementsLocation m_location
Definition: element.h:211
Element::dimensions
QSize dimensions
Definition: element.h:219
Element::m_names
NamesList m_names
Definition: element.h:212
numerotationcontextcommands.h
ElementsLocation::isElement
bool isElement() const
ElementsLocation::isElement.
Definition: elementslocation.cpp:412
ElementsLocation::baseName
QString baseName() const
ElementsLocation::baseName.
Definition: elementslocation.cpp:142
Element::textsGroupAboutToBeRemoved
void textsGroupAboutToBeRemoved(ElementTextItemGroup *group)
Element::m_low_zoom_picture
const QPicture m_low_zoom_picture
Definition: element.h:215
ElementPropertiesWidget::findEditClicked
void findEditClicked()
NumerotationContextCommands::next
NumerotationContext next()
NumerotationContextCommands::next.
Definition: numerotationcontextcommands.cpp:41
ElementPictureFactory::getPictures
void getPictures(const ElementsLocation &location, QPicture &picture, QPicture &low_picture)
ElementPictureFactory::getPictures Set the picture of the element at location. Note,...
Definition: elementpicturefactory.cpp:42
Element::initLink
virtual void initLink(QETProject *)
Element::initLink Initialise the link between this element and other elements. This method can be cal...
Definition: element.cpp:1508
DynamicElementTextItem::Type
@ Type
Definition: dynamicelementtextitem.h:61
Element::parseDynamicText
DynamicElementTextItem * parseDynamicText(const QDomElement &dom_element)
Element::parseDynamicText Create the dynamic text field describ in dom_element.
Definition: element.cpp:597
Element::kindInformations
DiagramContext kindInformations() const
Definition: element.h:100
qet.h
Element::removeTextFromGroup
bool removeTextFromGroup(DynamicElementTextItem *text, ElementTextItemGroup *group)
Element::removeTextFromGroup Remove the text text from the group group, en reparent text to this elem...
Definition: element.cpp:1455
ElementPictureFactory::pixmap
QPixmap pixmap(const ElementsLocation &location)
ElementPictureFactory::pixmap.
Definition: elementpicturefactory.cpp:76
Element::mouseReleaseEvent
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
Element::mouseReleaseEvent.
Definition: element.cpp:1604
DynamicElementTextItem::setText
void setText(const QString &text)
DynamicElementTextItem::setText Set the text of this text.
Definition: dynamicelementtextitem.cpp:387
ElementTextItemGroup::setPos
void setPos(const QPointF &pos)
Definition: elementtextitemgroup.cpp:525
Element::parseTerminal
Terminal * parseTerminal(const QDomElement &dom_element)
Element::parseTerminal Parse partTerminal from xml structure.
Definition: element.cpp:619
Element::setUpFormula
void setUpFormula(bool code_letter=true)
Element::setUpFormula Set up the formula used to create the label of this element.
Definition: element.cpp:1654
Element::m_link_type
kind m_link_type
Definition: element.h:203
DynamicElementTextItem::setInfoName
void setInfoName(const QString &info_name)
DynamicElementTextItem::setInfoName Set the information name of the parent element.
Definition: dynamicelementtextitem.cpp:400
elementprovider.h
autonum::setSequential
void setSequential(const QString &label, sequentialNumbers &seqStruct, NumerotationContext &context, Diagram *diagram, const QString &hashKey)
setSequential Fill seqStruct
Definition: assignvariables.cpp:434
ElementsLocation::xml
QDomElement xml() const
ElementsLocation::xml.
Definition: elementslocation.cpp:575
QET::GIOK
@ GIOK
General state.
Definition: qet.h:39
Element::m_must_highlight
bool m_must_highlight
Definition: element.h:218
QET::correctAngle
qreal correctAngle(const qreal &)
Definition: qet.cpp:545
ElementTextItemGroup::setRotation
void setRotation(qreal angle)
Definition: elementtextitemgroup.cpp:519
Element::location
ElementsLocation location() const
Definition: element.cpp:1760
elementslocation.h
Element::Element
Element(const ElementsLocation &location, QGraphicsItem *=nullptr, int *state=nullptr, Element::kind link_type=Element::Simple)
Element::Element.
Definition: element.cpp:79
Element::drawSelection
void drawSelection(QPainter *, const QStyleOptionGraphicsItem *)
Definition: element.cpp:311
Element::fromXml
virtual bool fromXml(QDomElement &, QHash< int, Terminal * > &, bool=false)
Element::fromXml Import the parameters of this element from a xml document. When call this function e...
Definition: element.cpp:684
Element::Element
Element(const Element &)
Element::sequenceStruct
autonum::sequentialNumbers sequenceStruct() const
Definition: element.h:106
Element::setHotspot
QPoint setHotspot(QPoint)
Definition: element.cpp:256
Element::AlignedFreeTerminals
QList< QPair< Terminal *, Terminal * > > AlignedFreeTerminals() const
Element::AlignedFreeTerminals.
Definition: element.cpp:1480
TerminalData
The TerminalData class Data of the terminal. Stored in extra class so it can be used by PartTerminal ...
Definition: terminaldata.h:20
Element::m_mouse_over
bool m_mouse_over
Definition: element.h:221
Element::getPrefix
QString getPrefix() const
Element::getPrefix get Element Prefix.
Definition: element.cpp:1699
autonum::elementPrefixForLocation
QString elementPrefixForLocation(const ElementsLocation &location)
elementPrefixForLocation
Definition: assignvariables.cpp:553
Element::kind
kind
The kind enum Used to know the kind of this element (master, slave, report ect...)
Definition: element.h:51
Element::Master
@ Master
Definition: element.h:55
ElementTextItemGroup::texts
QList< DynamicElementTextItem * > texts() const
ElementTextItemGroup::texts.
Definition: elementtextitemgroup.cpp:330
autonum::sequentialNumbers::hundred_folio
QStringList hundred_folio
Definition: assignvariables.h:54
Element::textRemovedFromGroup
void textRemovedFromGroup(DynamicElementTextItem *text, ElementTextItemGroup *group)
Element::removeDynamicTextItem
void removeDynamicTextItem(DynamicElementTextItem *deti)
Element::removeDynamicTextItem Remove deti, no matter if is a child of this element or a child of a g...
Definition: element.cpp:1287
Diagram::convertPosition
DiagramPosition convertPosition(const QPointF &)
Diagram::convertPosition.
Definition: diagram.cpp:2223
element.h
NamesList::name
QString name(const QString &=QString()) const
Definition: nameslist.cpp:231
Element::addDynamicTextItem
void addDynamicTextItem(DynamicElementTextItem *deti=nullptr)
Element::addDynamiqueTextItem Add deti as a dynamic text item of this element, deti is reparented to ...
Definition: element.cpp:1264
comparPos
bool comparPos(const Element *elmt1, const Element *elmt2)
comparPos Compare position of the two elements. Compare 3 points: 1 folio - 2 row - 3 line returns a ...
Definition: element.cpp:1566
QetGraphicsItem::m_state
QET::GraphicsItemState m_state
Definition: qetgraphicsitem.h:60
ElementTextItemGroup::removeFromGroup
void removeFromGroup(QGraphicsItem *item)
ElementTextItemGroup::removeFromGroup.
Definition: elementtextitemgroup.cpp:101
Element::name
QString name() const override
Element::name.
Definition: element.cpp:1756
Element::connected_elements
QList< Element * > connected_elements
Definition: element.h:200
DiagramContext::value
QVariant value(const QString &key) const
Definition: diagramcontext.cpp:100
Element
Definition: element.h:41
Element::isFree
bool isFree() const
Definition: element.h:230
Element::terminals
QList< Terminal * > terminals() const
Element::terminals.
Definition: element.cpp:136
autonum::AssignVariables::formulaToLabel
static QString formulaToLabel(QString formula, sequentialNumbers &seqStruct, Diagram *diagram, const Element *elmt=nullptr)
AssignVariables::formulaToLabel Return the formula with variable assigned (ready to be displayed)
Definition: assignvariables.cpp:187
ElementPictureFactory
The ElementPictureFactory class This class is singleton factory, use to create and get the picture us...
Definition: elementpicturefactory.h:38
Terminal::drawHelpLine
void drawHelpLine(bool draw=true)
Terminal::drawHelpLine.
Definition: terminal.cpp:359
Element::AllReport
@ AllReport
Definition: element.h:54
Element::freezeNewAddedElement
void freezeNewAddedElement()
Element::freezeNewAddedElement Freeze this label if needed.
Definition: element.cpp:1724
ElementPictureFactory::instance
static ElementPictureFactory * instance()
instance
Definition: elementpicturefactory.h:55
Element::type
int type() const override
Definition: element.h:75
elementpropertieswidget.h
ElementsLocation
The ElementsLocation class This class represents the location, the location of an element or of a cat...
Definition: elementslocation.h:46
terminaldata.h
NamesList::fromXml
void fromXml(const QDomElement &, const QHash< QString, QString > &=QHash< QString, QString >())
Definition: nameslist.cpp:113
Element::unlinkAllElements
virtual void unlinkAllElements()
Definition: element.h:155
Element::textsGroupAdded
void textsGroupAdded(ElementTextItemGroup *group)
Element::m_F_str
QString m_F_str
Definition: element.h:209
ElementTextItemGroup::addToGroup
void addToGroup(QGraphicsItem *item)
ElementTextItemGroup::addToGroup.
Definition: elementtextitemgroup.cpp:70
Element::editProperty
void editProperty() override
Definition: element.cpp:157
Element::valideXml
static bool valideXml(QDomElement &)
Definition: element.cpp:651
QETProject
Definition: qetproject.h:51
Element::textAddedToGroup
void textAddedToGroup(DynamicElementTextItem *text, ElementTextItemGroup *group)
QetGraphicsItem::mouseMoveEvent
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
Definition: qetgraphicsitem.cpp:108
Element::unlinkElement
virtual void unlinkElement(Element *)
Definition: element.h:156
NamesList
Definition: nameslist.h:30
ElementPropertiesWidget
Definition: elementpropertieswidget.h:32
Element::m_freeze_label
bool m_freeze_label
Definition: element.h:208
ElementTextItemGroup::setAlignment
void setAlignment(Qt::Alignment alignement)
ElementTextItemGroup::setAlignement Set the alignement of this group.
Definition: elementtextitemgroup.cpp:144
ElementTextItemGroup
The ElementTextItemGroup class This class represent a group of element text Texts in the group can be...
Definition: elementtextitemgroup.h:36
QETProject::elementAutoNumCurrentFormula
QString elementAutoNumCurrentFormula() const
QETProject::elementAutoNumCurrentFormula.
Definition: qetproject.cpp:523
Element::textRemoved
void textRemoved(DynamicElementTextItem *deti)
Element::m_terminals
QList< Terminal * > m_terminals
Definition: element.h:213
Element::displayHelpLine
void displayHelpLine(bool b=true)
Element::displayHelpLine Display the help line of each terminal if b is true.
Definition: element.cpp:188
Element::removeTextGroup
void removeTextGroup(ElementTextItemGroup *group)
Element::removeTextGroup Remove the text group group from this element, and set the parent of group t...
Definition: element.cpp:1378
Element::m_uuid
QUuid m_uuid
Definition: element.h:202
Element::hotspot_coord
QPoint hotspot_coord
Definition: element.h:220
Element::drawAxes
void drawAxes(QPainter *, const QStyleOptionGraphicsItem *)
Definition: element.cpp:291
DynamicElementTextItem::setTextFrom
void setTextFrom(DynamicElementTextItem::TextFrom text_from)
DynamicElementTextItem::setTextFrom Set the final text is created from.
Definition: dynamicelementtextitem.cpp:324
DiagramContext::keyMustShow
bool keyMustShow(const QString &) const
DiagramContext::keyMustShow.
Definition: diagramcontext.cpp:123
DiagramTextItem::setFont
void setFont(const QFont &font)
Definition: diagramtextitem.cpp:153
Diagram::folioIndex
int folioIndex() const
Diagram::folioIndex.
Definition: diagram.cpp:2335
DiagramContext::toXml
void toXml(QDomElement &, const QString &="property") const
Definition: diagramcontext.cpp:142
comparPos
bool comparPos(const Element *elmt1, const Element *elmt2)
comparPos Compare position of the two elements. Compare 3 points: 1 folio - 2 row - 3 line returns a ...
Definition: element.cpp:1566
PropertiesEditorDialog
The PropertiesEditorDialog class Create a dialog to edit some properties of a thing....
Definition: propertieseditordialog.h:42
QET::attributeIsAnInteger
bool attributeIsAnInteger(const QDomElement &, const QString &, int *=nullptr)
Definition: qet.cpp:210
autonum::sequentialNumbers::toXml
QDomElement toXml(QDomDocument &document, const QString &tag_name=QString("sequentialNumbers")) const
sequentialNumbers::toXml export this sequential numbers into a QDomElement.
Definition: assignvariables.cpp:94
diagramcontext.h
ElementTextItemGroup::setHoldToBottomPage
void setHoldToBottomPage(bool hold)
Definition: elementtextitemgroup.cpp:274
autonum::sequentialNumbers::ten_folio
QStringList ten_folio
Definition: assignvariables.h:52
QET::GIBuildingFromXml
@ GIBuildingFromXml
Item is currently building from a xml description (element)
Definition: qet.h:40
Element::m_autoNum_seq
autonum::sequentialNumbers m_autoNum_seq
Definition: element.h:207
QET::GILoadingFromXml
@ GILoadingFromXml
Item is loading her properties from a xml description.
Definition: qet.h:41
DiagramTextItem::font
QFont font
Definition: diagramtextitem.h:40
dynamicelementtextitem.h
TerminalData::fromXml
bool fromXml(const QDomElement &xml_element) override
TerminalData::fromXml load properties to xml element.
Definition: terminaldata.cpp:106
Element::textGroup
ElementTextItemGroup * textGroup(const QString &name) const
Element::textGroup.
Definition: element.cpp:1407
ElementTextItemGroup::setVerticalAdjustment
void setVerticalAdjustment(int v)
ElementTextItemGroup::setVerticalAdjustment Set the value of the vertical adjustment to v....
Definition: elementtextitemgroup.cpp:256
Element::conductors
QList< Conductor * > conductors() const
Element::conductors.
Definition: element.cpp:146
Conductor
Definition: conductor.h:43
Element::setPrefix
void setPrefix(QString)
Element::setPrefix set Element Prefix.
Definition: element.cpp:1707
QETProject::elementAutoNum
QHash< QString, NumerotationContext > elementAutoNum() const
QETProject::elementAutoNum.
Definition: qetproject.cpp:501
Element::toXml
virtual QDomElement toXml(QDomDocument &, QHash< Terminal *, int > &) const
Element::toXml Allows to export the element in XML.
Definition: element.cpp:1130
Element::mouseMoveEvent
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
Element::mouseMoveEvent.
Definition: element.cpp:1591
terminal.h
Terminal
The Terminal class This class represents a terminal of an electrical element, i.e....
Definition: terminal.h:35
Element::rSequenceStruct
autonum::sequentialNumbers & rSequenceStruct()
Definition: element.h:108
Element::freezeLabel
void freezeLabel(bool freeze)
Element::freezeLabel Freeze this element label.
Definition: element.cpp:1715
ElementProvider::fromUuids
QList< Element * > fromUuids(QList< QUuid >) const
ElementProvider::fromUuids.
Definition: elementprovider.cpp:75
DiagramContext::addValue
bool addValue(const QString &, const QVariant &, bool show=true)
Definition: diagramcontext.cpp:91
Element::boundingRect
QRectF boundingRect() const override
Definition: element.cpp:222
DynamicElementTextItem::setTextWidth
void setTextWidth(qreal width)
Definition: dynamicelementtextitem.cpp:1369
ElementXmlRetroCompatibility::loadSequential
static void loadSequential(const QDomElement &dom_element, Element *element)
Definition: element.cpp:56
Element::textGroups
QList< ElementTextItemGroup * > textGroups() const
Element::textGroups.
Definition: element.cpp:1420
QET::Icons::tr
QIcon tr
Definition: qeticons.cpp:206
Element::PreviousReport
@ PreviousReport
Definition: element.h:53
autonum::sequentialNumbers::unit
QStringList unit
Definition: assignvariables.h:49
QET::attributeIsAReal
bool attributeIsAReal(const QDomElement &, const QString &, qreal *=nullptr)
Definition: qet.cpp:231
DynamicElementTextItem::ElementInfo
@ ElementInfo
Definition: dynamicelementtextitem.h:57
QetGraphicsItem::state
QET::GraphicsItemState state() const
QetGraphicsItem::state.
Definition: qetgraphicsitem.cpp:70
autonum::sequentialNumbers::ten
QStringList ten
Definition: assignvariables.h:51
Element::dynamicTextItems
QList< DynamicElementTextItem * > dynamicTextItems() const
Element::dynamicTextItems.
Definition: element.cpp:1316
DiagramContext
Definition: diagramcontext.h:56
diagram.h
Element::m_dynamic_text_list
QList< DynamicElementTextItem * > m_dynamic_text_list
Definition: element.h:223
ElementXmlRetroCompatibility::loadSequential
static void loadSequential(const QDomElement &dom_element, const QString &seq, QStringList *list)
Definition: element.cpp:41
Element::hoverEnterEvent
void hoverEnterEvent(QGraphicsSceneHoverEvent *) override
Definition: element.cpp:1619
QET::Icons::Terminal
QIcon Terminal
Definition: qeticons.cpp:164
autonum::sequentialNumbers::hundred
QStringList hundred
Definition: assignvariables.h:53