mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-03-10 10:19:59 +01:00
add comments and move some initializations from the source file to the header file
This commit is contained in:
@@ -212,7 +212,7 @@ void DynamicElementTextItem::fromXml(const QDomElement &dom_elmt)
|
|||||||
setColor(QColor(dom_color.text()));
|
setColor(QColor(dom_color.text()));
|
||||||
|
|
||||||
//Force the update of the displayed text
|
//Force the update of the displayed text
|
||||||
setTextFrom(m_text_from);
|
setTextFrom(m_text_from); // TODO: does not update because there is a retrun inside if the textfrom argument is the same as m_text_from
|
||||||
|
|
||||||
QGraphicsTextItem::setPos(dom_elmt.attribute("x", QString::number(0)).toDouble(),
|
QGraphicsTextItem::setPos(dom_elmt.attribute("x", QString::number(0)).toDouble(),
|
||||||
dom_elmt.attribute("y", QString::number(0)).toDouble());
|
dom_elmt.attribute("y", QString::number(0)).toDouble());
|
||||||
|
|||||||
@@ -745,7 +745,7 @@ bool Element::fromXml(QDomElement &e, QHash<int, Terminal *> &table_id_adr, bool
|
|||||||
|
|
||||||
//************************//
|
//************************//
|
||||||
//***Dynamic texts item***//
|
//***Dynamic texts item***//
|
||||||
//************************//
|
//************************// read from the diagram section
|
||||||
for (const QDomElement& qde : QET::findInDomElement(e, "dynamic_texts", DynamicElementTextItem::xmlTagName()))
|
for (const QDomElement& qde : QET::findInDomElement(e, "dynamic_texts", DynamicElementTextItem::xmlTagName()))
|
||||||
{
|
{
|
||||||
DynamicElementTextItem *deti = new DynamicElementTextItem(this);
|
DynamicElementTextItem *deti = new DynamicElementTextItem(this);
|
||||||
@@ -757,16 +757,16 @@ bool Element::fromXml(QDomElement &e, QHash<int, Terminal *> &table_id_adr, bool
|
|||||||
//************************//
|
//************************//
|
||||||
//***Element texts item***//
|
//***Element texts item***//
|
||||||
//************************//
|
//************************//
|
||||||
QList<QDomElement> inputs = QET::findInDomElement(e, "inputs", "input");
|
QList<QDomElement> inputs = QET::findInDomElement(e, "inputs", "input"); // inputs in diagram section
|
||||||
|
|
||||||
//First case, we check for the text item converted to dynamic text item
|
//First case, we check for the text item converted to dynamic text item
|
||||||
const QList <DynamicElementTextItem *> conv_deti_list = m_converted_text_from_xml_description.keys();
|
const QList <DynamicElementTextItem *> conv_deti_list = m_converted_text_from_xml_description.keys();
|
||||||
QList <DynamicElementTextItem *> successfully_converted;
|
QList <DynamicElementTextItem *> successfully_converted;
|
||||||
const QList <QDomElement> dom_inputs = inputs;
|
const QList <QDomElement> dom_inputs = inputs;
|
||||||
|
// TODO: legacy???
|
||||||
for (DynamicElementTextItem *deti : conv_deti_list)
|
for (DynamicElementTextItem *deti : conv_deti_list) // elements read from the element collection definition
|
||||||
{
|
{
|
||||||
for(const QDomElement& dom_input : dom_inputs)
|
for(const QDomElement& dom_input : dom_inputs)
|
||||||
{
|
{
|
||||||
//we use the same method used in ElementTextItem::fromXml to compar and know if the input dom element is for one of the text stored.
|
//we use the same method used in ElementTextItem::fromXml to compar and know if the input dom element is for one of the text stored.
|
||||||
//The comparaison is made from the text position : if the position of the text is the same as the position stored in 'input' dom element
|
//The comparaison is made from the text position : if the position of the text is the same as the position stored in 'input' dom element
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
SlaveElement::SlaveElement(const ElementsLocation &location, QGraphicsItem *qgi, int *state) :
|
SlaveElement::SlaveElement(const ElementsLocation &location, QGraphicsItem *qgi, int *state) :
|
||||||
Element(location, qgi, state, Element::Slave)
|
Element(location, qgi, state, Element::Slave)
|
||||||
{
|
{
|
||||||
m_xref_item = nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class SlaveElement : public Element
|
|||||||
void unlinkElement(Element *elmt) override;
|
void unlinkElement(Element *elmt) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QGraphicsTextItem *m_xref_item;
|
QGraphicsTextItem *m_xref_item{nullptr};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SLAVEELEMENT_H
|
#endif // SLAVEELEMENT_H
|
||||||
|
|||||||
Reference in New Issue
Block a user