diff --git a/sources/diagram.cpp b/sources/diagram.cpp index fd34414de..e9cb164a5 100644 --- a/sources/diagram.cpp +++ b/sources/diagram.cpp @@ -1125,7 +1125,7 @@ bool Diagram::fromXml(QDomElement &document, QPointF position, bool consider_inf QPointF point_ = items_rect.topLeft(); QPointF pos_ = Diagram::snapToGrid(QPointF (position.x() - point_.x(), - position.y() - point_.y())); + position.y() - point_.y())); //Translate all added items for (auto qgi : added_items) diff --git a/sources/editor/graphicspart/customelementpart.cpp b/sources/editor/graphicspart/customelementpart.cpp index cd80fb972..f04dca94d 100644 --- a/sources/editor/graphicspart/customelementpart.cpp +++ b/sources/editor/graphicspart/customelementpart.cpp @@ -66,7 +66,10 @@ QET::ScalingMethod CustomElementPart::preferredScalingMethod() const { @param points List of points when the movement started, in scene coordinates. @return The list of points mapped from initial_selection_rect to new_selection_rect */ -QList CustomElementPart::mapPoints(const QRectF &initial_selection_rect, const QRectF &new_selection_rect, const QList &points) { +QList CustomElementPart::mapPoints( + const QRectF &initial_selection_rect, + const QRectF &new_selection_rect, + const QList &points) { QList new_points; if (!points.count()) return(new_points); diff --git a/sources/editor/graphicspart/customelementpart.h b/sources/editor/graphicspart/customelementpart.h index 3b58a5698..9f3eaddc7 100644 --- a/sources/editor/graphicspart/customelementpart.h +++ b/sources/editor/graphicspart/customelementpart.h @@ -29,21 +29,27 @@ class QGraphicsItem; class QGraphicsSceneMouseEvent; /** - This abstract class represents a primitive of the visual representation of an - electrical element. The Element, FixedElement and CustomElement classes do not - embed its attributes and methods in order to remain lightweight; indeed, there - is no point for those classes to store their visual representation with - anything more complex than a QImage. + @brief The CustomElementPart class + This abstract class represents a primitive of + the visual representation of an electrical element. + The Element, FixedElement and CustomElement classes do not embed + its attributes and methods in order to remain lightweight; indeed, + there is no point for those classes to store their visual representation + with anything more complex than a QImage. */ class CustomElementPart { // constructors, destructor public: /** + @brief CustomElementPart Constructor @param editor Element editor this primitive is attached to */ CustomElementPart(QETElementEditor *editor) : element_editor(editor) {} - /// Destructor + /** + @brief ~CustomElementPart + Destructor + */ virtual ~CustomElementPart() {} private: @@ -78,13 +84,15 @@ class CustomElementPart { virtual bool isUseless() const = 0; virtual QRectF sceneGeometricRect() const = 0; /** - Inform this part a user-induced transformation is about to begin. This method can be used to save data required by handleUserTransformation(). + Inform this part a user-induced transformation is about to begin. + This method can be used to save data required by handleUserTransformation(). */ virtual void startUserTransformation(const QRectF &) = 0; /** Make this part fit into the provided rectangle. */ - virtual void handleUserTransformation(const QRectF &, const QRectF &) = 0; + virtual void handleUserTransformation(const QRectF &, + const QRectF &) = 0; /// @return a pointer to the parent element editor virtual QETElementEditor *elementEditor() const; /** @@ -106,6 +114,9 @@ class CustomElementPart { virtual QET::ScalingMethod preferredScalingMethod() const; protected: - QList mapPoints(const QRectF &, const QRectF &, const QList &); + QList mapPoints( + const QRectF &, + const QRectF &, + const QList &); }; #endif diff --git a/sources/editor/graphicspart/partterminal.cpp b/sources/editor/graphicspart/partterminal.cpp index 38924646e..f8256e02b 100644 --- a/sources/editor/graphicspart/partterminal.cpp +++ b/sources/editor/graphicspart/partterminal.cpp @@ -133,12 +133,15 @@ void PartTerminal::setOrientation(Qet::Orientation ori) updateSecondPoint(); emit orientationChanged(); } - +/** + @brief PartTerminal::setName + @param name +*/ void PartTerminal::setName(QString& name) { - if (d->m_name == name) return; - d->m_name = name; - emit nameChanged(); + if (d->m_name == name) return; + d->m_name = name; + emit nameChanged(); } /** diff --git a/sources/qetgraphicsitem/element.cpp b/sources/qetgraphicsitem/element.cpp index 26a25178c..44adc4302 100644 --- a/sources/qetgraphicsitem/element.cpp +++ b/sources/qetgraphicsitem/element.cpp @@ -997,12 +997,20 @@ bool Element::fromXml(QDomElement &e, QHash &table_id_adr, bool } /** - Permet d'exporter l'element en XML - @param document Document XML a utiliser - @param table_adr_id Table de correspondance entre les adresses des bornes - et leur id dans la representation XML ; cette table completee par cette - methode - @return L'element XML representant cet element electrique + @brief Element::toXml + Allows to export the element in XML + \~French Permet d'exporter l'element en XML + \~ @param document : XML document to use + \~French Document XML a utiliser + \~ @param table_adr_id : + Correspondence table between the addresses of the terminals + and their id in the XML representation; + this table completed by this method + \~French Table de correspondance entre les adresses des bornes + et leur id dans la representation XML ; + cette table completee par cette methode + \~ @return The XML element representing this electrical element + \~French L'element XML representant cet element electrique */ QDomElement Element::toXml(QDomDocument &document, QHash &table_adr_id) const { @@ -1031,7 +1039,8 @@ QDomElement Element::toXml(QDomDocument &document, QHash &table element.setAttribute("z", QString::number(this->zValue())); element.setAttribute("orientation", QString::number(orientation())); - /* recupere le premier id a utiliser pour les bornes de cet element */ + /* get the first id to use for the bounds of this element + * recupere le premier id a utiliser pour les bornes de cet element */ int id_terminal = 0; if (!table_adr_id.isEmpty()) { // trouve le plus grand id @@ -1042,8 +1051,10 @@ QDomElement Element::toXml(QDomDocument &document, QHash &table id_terminal = max_id_t + 1; } + // registration of device terminals // enregistrement des bornes de l'appareil QDomElement xml_terminals = document.createElement("terminals"); + // for each child of the element // pour chaque enfant de l'element foreach(Terminal *t, terminals()) { // alors on enregistre la borne diff --git a/sources/qetgraphicsitem/terminal.cpp b/sources/qetgraphicsitem/terminal.cpp index 1f32441b6..9274fbf1f 100644 --- a/sources/qetgraphicsitem/terminal.cpp +++ b/sources/qetgraphicsitem/terminal.cpp @@ -113,7 +113,6 @@ Terminal::Terminal(QPointF pf, Qet::Orientation o, Element *e) : @param pf_y Ordonnee du point d'amarrage pour un conducteur @param o orientation de la borne : Qt::Horizontal ou Qt::Vertical @param e Element auquel cette borne appartient - @param s Scene sur laquelle figure cette borne */ Terminal::Terminal(qreal pf_x, qreal pf_y, Qet::Orientation o, Element *e) : QGraphicsObject(e),