|
QElectroTech
0.8-dev
|
Go to the documentation of this file.
60 QGraphicsItem * =
nullptr,
74 enum {
Type = UserType + 1000 };
118 QString
name()
const override;
128 virtual bool fromXml(QDomElement &,
132 virtual QDomElement
toXml(QDomDocument &,
146 QList<ElementTextItemGroup *>
textGroups()
const;
164 void drawAxes(QPainter *,
const QStyleOptionGraphicsItem *);
169 const QStyleOptionGraphicsItem *);
171 const QStyleOptionGraphicsItem *);
172 bool buildFromXml(
const QDomElement &,
int * =
nullptr);
174 bool parseInput(
const QDomElement &dom_element);
176 const QDomElement &dom_element);
181 void paint(QPainter *,
182 const QStyleOptionGraphicsItem *,
188 QGraphicsSceneMouseEvent *event)
override;
196 QHash <DynamicElementTextItem *, QPointF>
bool exist() const
ElementsLocation::exist.
Definition: elementslocation.cpp:472
@ Terminale
Definition: element.h:57
QList< QUuid > tmp_uuids_link
Definition: element.h:201
static bool valideXml(QDomElement &)
Terminal::valideXml Permet de savoir si un element XML represente une borne.
Definition: terminal.cpp:746
void setSize(int, int)
Element::setSize Define the size of the element. The size must be a multiple of 10....
Definition: element.cpp:235
QSize size() const
Definition: element.cpp:247
QList< Conductor * > conductors() const
Terminal::conductors.
Definition: terminal.cpp:715
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
QList< QString > keys(KeyOrder=None) const
Definition: diagramcontext.cpp:49
virtual kind linkType() const
Definition: element.h:159
QList< ElementTextItemGroup * > m_texts_group
Definition: element.h:224
QString m_prefix
Definition: element.h:222
void addElementAutoNum(const QString &key, const NumerotationContext &context)
QETProject::addElementAutoNum Add a new element numerotation context. If key already exist,...
Definition: qetproject.cpp:598
QPoint hotspot() const
Definition: element.cpp:272
bool parseElement(const QDomElement &dom)
Element::parseElement Parse the element of the xml description of this element.
Definition: element.cpp:526
DiagramContext m_kind_informations
Definition: element.h:206
bool buildFromXml(const QDomElement &, int *=nullptr)
Element::buildFromXml Build this element from an xml description.
Definition: element.cpp:376
~Element() override
Element::~Element.
Definition: element.cpp:126
const QPicture m_picture
Definition: element.h:214
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
The DynamicElementTextItem class This class provide a simple text field of element who can be added o...
Definition: dynamicelementtextitem.h:39
Definition: qetgraphicsitem.h:27
void fromXml(const QDomElement &, const QString &="property")
Definition: diagramcontext.cpp:157
Definition: assignvariables.h:35
void clear()
Definition: assignvariables.cpp:165
QHash< DynamicElementTextItem *, QPointF > m_converted_text_from_xml_description
Definition: element.h:197
QList< Element * > linkedElements()
Element::linkedElements.
Definition: element.h:258
DiagramContext m_element_informations
Definition: element.h:206
void fromXml(const QDomElement &element)
sequentialNumbers::fromXml Import sequential values from a QDomElement
Definition: assignvariables.cpp:138
Definition: elementprovider.h:37
QString path() const
ElementsLocation::path.
Definition: elementslocation.cpp:206
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
QetGraphicsItem::mouseReleaseEvent handle mouse release click.
Definition: qetgraphicsitem.cpp:149
QPixmap pixmap()
Element::pixmap.
Definition: element.cpp:280
DiagramContext elementInformations() const
Definition: element.h:97
Diagram * diagram() const
Definition: qetgraphicsitem.cpp:40
QUuid uuid() const
Element::uuid.
Definition: element.h:250
const QString version
QElectroTech version (as string, used to mark projects and elements XML documents)
Definition: qet.h:32
void newUuid()
Definition: element.h:161
@ NextReport
Definition: element.h:52
QString linkTypeToString() const
Definition: element.cpp:1520
Element * parentElement() const
ElementTextItemGroup::parentElement.
Definition: elementtextitemgroup.cpp:357
Definition: element.cpp:38
bool isFreezeLabel() const
Definition: element.h:114
QString letter() const
Definition: diagramposition.h:42
QUuid m_uuid
Definition: dynamicelementtextitem.h:150
static QString xmlTagName()
Definition: dynamicelementtextitem.h:94
virtual void setHighlighted(bool)
Definition: element.cpp:178
QString actualLabel()
Element::actualLabel Always return the current label to be displayed. This function is usefull when l...
Definition: element.cpp:1738
void fromXml(QDomElement &dom_element)
ElementTextItemGroup::fromXml Import data of this group from xml.
Definition: elementtextitemgroup.cpp:405
void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) override
Element::paint.
Definition: element.cpp:199
void setFrame(const bool frame)
Definition: dynamicelementtextitem.cpp:506
QStringList unit_folio
Definition: assignvariables.h:50
The NumerotationContextCommands class this class provide methods to handle content of NumerotationCon...
Definition: numerotationcontextcommands.h:31
The DiagramEventAddElement class This diagram event add a new element, for each left click button at ...
Definition: diagrameventaddelement.h:32
void hoverLeaveEvent(QGraphicsSceneHoverEvent *) override
Definition: element.cpp:1636
void textAdded(DynamicElementTextItem *deti)
void drawHighlight(QPainter *, const QStyleOptionGraphicsItem *)
Definition: element.cpp:337
virtual void linkToElement(Element *)
Definition: element.h:154
void elementInfoChange(DiagramContext old_info, DiagramContext new_info)
void linkedElementChanged()
@ Simple
Definition: element.h:51
QString elementCurrentAutoNum() const
QETProject::elementCurrentAutoNum.
Definition: qetproject.cpp:531
void fromXml(const QDomElement &dom_elmt) override
DynamicElementTextItem::fromXml Import this text from xml.
Definition: dynamicelementtextitem.cpp:154
static QString xmlTaggName()
Definition: elementtextitemgroup.h:82
@ Slave
Definition: element.h:56
Definition: numerotationcontext.h:31
@ Type
Definition: element.h:74
QList< QDomElement > findInDomElement(const QDomElement &, const QString &)
Definition: qet.cpp:333
@ Label
Definition: xrefproperties.h:40
virtual void setElementInformations(DiagramContext dc)
Element::setElementInformations Set new information for this element. If new information is different...
Definition: element.cpp:1547
QETProject * project() const
Diagram::project.
Definition: diagram.cpp:2326
int orientation() const
Definition: element.h:242
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
ElementsLocation m_location
Definition: element.h:211
QSize dimensions
Definition: element.h:219
NamesList m_names
Definition: element.h:212
bool isElement() const
ElementsLocation::isElement.
Definition: elementslocation.cpp:412
QString baseName() const
ElementsLocation::baseName.
Definition: elementslocation.cpp:142
void textsGroupAboutToBeRemoved(ElementTextItemGroup *group)
const QPicture m_low_zoom_picture
Definition: element.h:215
NumerotationContext next()
NumerotationContextCommands::next.
Definition: numerotationcontextcommands.cpp:41
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
virtual void initLink(QETProject *)
Element::initLink Initialise the link between this element and other elements. This method can be cal...
Definition: element.cpp:1508
@ Type
Definition: dynamicelementtextitem.h:61
DynamicElementTextItem * parseDynamicText(const QDomElement &dom_element)
Element::parseDynamicText Create the dynamic text field describ in dom_element.
Definition: element.cpp:597
DiagramContext kindInformations() const
Definition: element.h:100
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
QPixmap pixmap(const ElementsLocation &location)
ElementPictureFactory::pixmap.
Definition: elementpicturefactory.cpp:76
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
Element::mouseReleaseEvent.
Definition: element.cpp:1604
void setText(const QString &text)
DynamicElementTextItem::setText Set the text of this text.
Definition: dynamicelementtextitem.cpp:387
void setPos(const QPointF &pos)
Definition: elementtextitemgroup.cpp:525
Terminal * parseTerminal(const QDomElement &dom_element)
Element::parseTerminal Parse partTerminal from xml structure.
Definition: element.cpp:619
void setUpFormula(bool code_letter=true)
Element::setUpFormula Set up the formula used to create the label of this element.
Definition: element.cpp:1654
kind m_link_type
Definition: element.h:203
void setInfoName(const QString &info_name)
DynamicElementTextItem::setInfoName Set the information name of the parent element.
Definition: dynamicelementtextitem.cpp:400
void setSequential(const QString &label, sequentialNumbers &seqStruct, NumerotationContext &context, Diagram *diagram, const QString &hashKey)
setSequential Fill seqStruct
Definition: assignvariables.cpp:434
QDomElement xml() const
ElementsLocation::xml.
Definition: elementslocation.cpp:575
@ GIOK
General state.
Definition: qet.h:39
bool m_must_highlight
Definition: element.h:218
qreal correctAngle(const qreal &)
Definition: qet.cpp:545
void setRotation(qreal angle)
Definition: elementtextitemgroup.cpp:519
ElementsLocation location() const
Definition: element.cpp:1760
Element(const ElementsLocation &location, QGraphicsItem *=nullptr, int *state=nullptr, Element::kind link_type=Element::Simple)
Element::Element.
Definition: element.cpp:79
void drawSelection(QPainter *, const QStyleOptionGraphicsItem *)
Definition: element.cpp:311
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
autonum::sequentialNumbers sequenceStruct() const
Definition: element.h:106
QPoint setHotspot(QPoint)
Definition: element.cpp:256
QList< QPair< Terminal *, Terminal * > > AlignedFreeTerminals() const
Element::AlignedFreeTerminals.
Definition: element.cpp:1480
The TerminalData class Data of the terminal. Stored in extra class so it can be used by PartTerminal ...
Definition: terminaldata.h:20
bool m_mouse_over
Definition: element.h:221
QString getPrefix() const
Element::getPrefix get Element Prefix.
Definition: element.cpp:1699
QString elementPrefixForLocation(const ElementsLocation &location)
elementPrefixForLocation
Definition: assignvariables.cpp:553
kind
The kind enum Used to know the kind of this element (master, slave, report ect...)
Definition: element.h:51
@ Master
Definition: element.h:55
QList< DynamicElementTextItem * > texts() const
ElementTextItemGroup::texts.
Definition: elementtextitemgroup.cpp:330
QStringList hundred_folio
Definition: assignvariables.h:54
void textRemovedFromGroup(DynamicElementTextItem *text, ElementTextItemGroup *group)
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
DiagramPosition convertPosition(const QPointF &)
Diagram::convertPosition.
Definition: diagram.cpp:2223
QString name(const QString &=QString()) const
Definition: nameslist.cpp:231
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
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
QET::GraphicsItemState m_state
Definition: qetgraphicsitem.h:60
void removeFromGroup(QGraphicsItem *item)
ElementTextItemGroup::removeFromGroup.
Definition: elementtextitemgroup.cpp:101
QString name() const override
Element::name.
Definition: element.cpp:1756
QList< Element * > connected_elements
Definition: element.h:200
QVariant value(const QString &key) const
Definition: diagramcontext.cpp:100
bool isFree() const
Definition: element.h:230
QList< Terminal * > terminals() const
Element::terminals.
Definition: element.cpp:136
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
The ElementPictureFactory class This class is singleton factory, use to create and get the picture us...
Definition: elementpicturefactory.h:38
void drawHelpLine(bool draw=true)
Terminal::drawHelpLine.
Definition: terminal.cpp:359
@ AllReport
Definition: element.h:54
void freezeNewAddedElement()
Element::freezeNewAddedElement Freeze this label if needed.
Definition: element.cpp:1724
static ElementPictureFactory * instance()
instance
Definition: elementpicturefactory.h:55
int type() const override
Definition: element.h:75
The ElementsLocation class This class represents the location, the location of an element or of a cat...
Definition: elementslocation.h:46
void fromXml(const QDomElement &, const QHash< QString, QString > &=QHash< QString, QString >())
Definition: nameslist.cpp:113
virtual void unlinkAllElements()
Definition: element.h:155
void textsGroupAdded(ElementTextItemGroup *group)
QString m_F_str
Definition: element.h:209
void addToGroup(QGraphicsItem *item)
ElementTextItemGroup::addToGroup.
Definition: elementtextitemgroup.cpp:70
void editProperty() override
Definition: element.cpp:157
static bool valideXml(QDomElement &)
Definition: element.cpp:651
Definition: qetproject.h:51
void textAddedToGroup(DynamicElementTextItem *text, ElementTextItemGroup *group)
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
Definition: qetgraphicsitem.cpp:108
virtual void unlinkElement(Element *)
Definition: element.h:156
Definition: nameslist.h:30
bool m_freeze_label
Definition: element.h:208
void setAlignment(Qt::Alignment alignement)
ElementTextItemGroup::setAlignement Set the alignement of this group.
Definition: elementtextitemgroup.cpp:144
The ElementTextItemGroup class This class represent a group of element text Texts in the group can be...
Definition: elementtextitemgroup.h:36
QString elementAutoNumCurrentFormula() const
QETProject::elementAutoNumCurrentFormula.
Definition: qetproject.cpp:523
void textRemoved(DynamicElementTextItem *deti)
QList< Terminal * > m_terminals
Definition: element.h:213
void displayHelpLine(bool b=true)
Element::displayHelpLine Display the help line of each terminal if b is true.
Definition: element.cpp:188
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
QUuid m_uuid
Definition: element.h:202
QPoint hotspot_coord
Definition: element.h:220
void drawAxes(QPainter *, const QStyleOptionGraphicsItem *)
Definition: element.cpp:291
void setTextFrom(DynamicElementTextItem::TextFrom text_from)
DynamicElementTextItem::setTextFrom Set the final text is created from.
Definition: dynamicelementtextitem.cpp:324
bool keyMustShow(const QString &) const
DiagramContext::keyMustShow.
Definition: diagramcontext.cpp:123
void setFont(const QFont &font)
Definition: diagramtextitem.cpp:153
int folioIndex() const
Diagram::folioIndex.
Definition: diagram.cpp:2335
void toXml(QDomElement &, const QString &="property") const
Definition: diagramcontext.cpp:142
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
The PropertiesEditorDialog class Create a dialog to edit some properties of a thing....
Definition: propertieseditordialog.h:42
bool attributeIsAnInteger(const QDomElement &, const QString &, int *=nullptr)
Definition: qet.cpp:210
QDomElement toXml(QDomDocument &document, const QString &tag_name=QString("sequentialNumbers")) const
sequentialNumbers::toXml export this sequential numbers into a QDomElement.
Definition: assignvariables.cpp:94
void setHoldToBottomPage(bool hold)
Definition: elementtextitemgroup.cpp:274
QStringList ten_folio
Definition: assignvariables.h:52
@ GIBuildingFromXml
Item is currently building from a xml description (element)
Definition: qet.h:40
autonum::sequentialNumbers m_autoNum_seq
Definition: element.h:207
@ GILoadingFromXml
Item is loading her properties from a xml description.
Definition: qet.h:41
QFont font
Definition: diagramtextitem.h:40
bool fromXml(const QDomElement &xml_element) override
TerminalData::fromXml load properties to xml element.
Definition: terminaldata.cpp:106
ElementTextItemGroup * textGroup(const QString &name) const
Element::textGroup.
Definition: element.cpp:1407
void setVerticalAdjustment(int v)
ElementTextItemGroup::setVerticalAdjustment Set the value of the vertical adjustment to v....
Definition: elementtextitemgroup.cpp:256
QList< Conductor * > conductors() const
Element::conductors.
Definition: element.cpp:146
Definition: conductor.h:43
void setPrefix(QString)
Element::setPrefix set Element Prefix.
Definition: element.cpp:1707
QHash< QString, NumerotationContext > elementAutoNum() const
QETProject::elementAutoNum.
Definition: qetproject.cpp:501
virtual QDomElement toXml(QDomDocument &, QHash< Terminal *, int > &) const
Element::toXml Allows to export the element in XML.
Definition: element.cpp:1130
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
Element::mouseMoveEvent.
Definition: element.cpp:1591
The Terminal class This class represents a terminal of an electrical element, i.e....
Definition: terminal.h:35
autonum::sequentialNumbers & rSequenceStruct()
Definition: element.h:108
void freezeLabel(bool freeze)
Element::freezeLabel Freeze this element label.
Definition: element.cpp:1715
QList< Element * > fromUuids(QList< QUuid >) const
ElementProvider::fromUuids.
Definition: elementprovider.cpp:75
bool addValue(const QString &, const QVariant &, bool show=true)
Definition: diagramcontext.cpp:91
QRectF boundingRect() const override
Definition: element.cpp:222
void setTextWidth(qreal width)
Definition: dynamicelementtextitem.cpp:1369
static void loadSequential(const QDomElement &dom_element, Element *element)
Definition: element.cpp:56
QList< ElementTextItemGroup * > textGroups() const
Element::textGroups.
Definition: element.cpp:1420
QIcon tr
Definition: qeticons.cpp:206
@ PreviousReport
Definition: element.h:53
QStringList unit
Definition: assignvariables.h:49
bool attributeIsAReal(const QDomElement &, const QString &, qreal *=nullptr)
Definition: qet.cpp:231
@ ElementInfo
Definition: dynamicelementtextitem.h:57
QET::GraphicsItemState state() const
QetGraphicsItem::state.
Definition: qetgraphicsitem.cpp:70
QStringList ten
Definition: assignvariables.h:51
QList< DynamicElementTextItem * > dynamicTextItems() const
Element::dynamicTextItems.
Definition: element.cpp:1316
Definition: diagramcontext.h:56
QList< DynamicElementTextItem * > m_dynamic_text_list
Definition: element.h:223
static void loadSequential(const QDomElement &dom_element, const QString &seq, QStringList *list)
Definition: element.cpp:41
void hoverEnterEvent(QGraphicsSceneHoverEvent *) override
Definition: element.cpp:1619
QIcon Terminal
Definition: qeticons.cpp:164
QStringList hundred
Definition: assignvariables.h:53