From 3471140b640734b0803f64243b6abeee6e711be5 Mon Sep 17 00:00:00 2001 From: plc-user <74435298+plc-user@users.noreply.github.com> Date: Fri, 14 Feb 2025 16:47:39 +0100 Subject: [PATCH 1/2] fix typo in fuction-name (looked like a mixture of French and English) --- sources/editor/elementprimitivedecorator.cpp | 8 +++---- sources/editor/elementprimitivedecorator.h | 2 +- sources/editor/graphicspart/partarc.cpp | 6 ++--- sources/editor/graphicspart/partarc.h | 8 +++---- sources/editor/graphicspart/partellipse.cpp | 8 +++---- sources/editor/graphicspart/partellipse.h | 4 ++-- sources/editor/graphicspart/partline.cpp | 10 ++++----- sources/editor/graphicspart/partline.h | 2 +- sources/editor/graphicspart/partpolygon.cpp | 10 ++++----- sources/editor/graphicspart/partpolygon.h | 2 +- sources/editor/graphicspart/partrectangle.cpp | 14 ++++++------ sources/editor/graphicspart/partrectangle.h | 2 +- sources/qetgraphicsitem/conductor.cpp | 8 +++---- sources/qetgraphicsitem/conductor.h | 2 +- sources/qetgraphicsitem/qetshapeitem.cpp | 22 +++++++++---------- sources/qetgraphicsitem/qetshapeitem.h | 2 +- 16 files changed, 55 insertions(+), 55 deletions(-) diff --git a/sources/editor/elementprimitivedecorator.cpp b/sources/editor/elementprimitivedecorator.cpp index 28a89ff66..5602160b7 100644 --- a/sources/editor/elementprimitivedecorator.cpp +++ b/sources/editor/elementprimitivedecorator.cpp @@ -120,7 +120,7 @@ void ElementPrimitiveDecorator::setItems(const QList &items if (focusItem() != this) { setFocus(); } - adjusteHandlerPos(); + adjustHandlerPos(); } /** @@ -356,7 +356,7 @@ void ElementPrimitiveDecorator::adjustEffectiveBoundingRect() prepareGeometryChange(); effective_bounding_rect_ = modified_bounding_rect_ | effective_bounding_rect_; update(); - adjusteHandlerPos(); + adjustHandlerPos(); } /** @@ -492,9 +492,9 @@ QVector ElementPrimitiveDecorator::getResizingsPoints() const } /** - @brief ElementPrimitiveDecorator::adjusteHandlerPos + @brief ElementPrimitiveDecorator::adjustHandlerPos */ -void ElementPrimitiveDecorator::adjusteHandlerPos() +void ElementPrimitiveDecorator::adjustHandlerPos() { QVector points_vector = mapToScene(getResizingsPoints()); for (int i = 0 ; i < points_vector.size() ; ++i) diff --git a/sources/editor/elementprimitivedecorator.h b/sources/editor/elementprimitivedecorator.h index 77db24916..1876bd95e 100644 --- a/sources/editor/elementprimitivedecorator.h +++ b/sources/editor/elementprimitivedecorator.h @@ -94,7 +94,7 @@ class ElementPrimitiveDecorator : public QGraphicsObject private: - void adjusteHandlerPos(); + void adjustHandlerPos(); void handlerMousePressEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event); void handlerMouseMoveEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event); void handlerMouseReleaseEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event); diff --git a/sources/editor/graphicspart/partarc.cpp b/sources/editor/graphicspart/partarc.cpp index cb697d42c..27f00fc73 100644 --- a/sources/editor/graphicspart/partarc.cpp +++ b/sources/editor/graphicspart/partarc.cpp @@ -207,7 +207,7 @@ QVariant PartArc::itemChange(QGraphicsItem::GraphicsItemChange change, const QVa { if (change == ItemPositionHasChanged) { - adjusteHandlerPos(); + adjustHandlerPos(); } else if (change == ItemSceneChange) { @@ -293,9 +293,9 @@ void PartArc::switchResizeMode() } /** - @brief PartArc::adjusteHandlerPos + @brief PartArc::adjustHandlerPos */ -void PartArc::adjusteHandlerPos() +void PartArc::adjustHandlerPos() { if (m_handler_vector.isEmpty()) return; diff --git a/sources/editor/graphicspart/partarc.h b/sources/editor/graphicspart/partarc.h index 078237b13..382ec84ce 100644 --- a/sources/editor/graphicspart/partarc.h +++ b/sources/editor/graphicspart/partarc.h @@ -56,9 +56,9 @@ class PartArc : public AbstractPartEllipse QPainterPath shape() const override; QPainterPath shadowShape() const override; - void setRect(const QRectF &rect) override {AbstractPartEllipse::setRect(rect); adjusteHandlerPos();} - void setStartAngle(const int &start_angle) override {AbstractPartEllipse::setStartAngle(start_angle); adjusteHandlerPos();} - void setSpanAngle(const int &span_angle) override {AbstractPartEllipse::setSpanAngle(span_angle); adjusteHandlerPos();} + void setRect(const QRectF &rect) override {AbstractPartEllipse::setRect(rect); adjustHandlerPos();} + void setStartAngle(const int &start_angle) override {AbstractPartEllipse::setStartAngle(start_angle); adjustHandlerPos();} + void setSpanAngle(const int &span_angle) override {AbstractPartEllipse::setSpanAngle(span_angle); adjustHandlerPos();} QRectF sceneGeometricRect() const override; void addHandler() override; @@ -71,7 +71,7 @@ class PartArc : public AbstractPartEllipse private: void switchResizeMode(); - void adjusteHandlerPos(); + void adjustHandlerPos(); void handlerMousePressEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event); void handlerMouseMoveEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event); void handlerMouseReleaseEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event); diff --git a/sources/editor/graphicspart/partellipse.cpp b/sources/editor/graphicspart/partellipse.cpp index 9c2ed802b..41e199e0c 100644 --- a/sources/editor/graphicspart/partellipse.cpp +++ b/sources/editor/graphicspart/partellipse.cpp @@ -186,7 +186,7 @@ QVariant PartEllipse::itemChange(QGraphicsItem::GraphicsItemChange change, const { if (change == ItemPositionHasChanged) { - adjusteHandlerPos(); + adjustHandlerPos(); } else if (change == ItemSceneChange) { @@ -253,9 +253,9 @@ void PartEllipse::switchResizeMode() } /** - @brief PartEllipse::adjusteHandlerPos + @brief PartEllipse::adjustHandlerPos */ -void PartEllipse::adjusteHandlerPos() +void PartEllipse::adjustHandlerPos() { if (m_handler_vector.isEmpty()) return; @@ -305,7 +305,7 @@ void PartEllipse::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsS else setRect(QetGraphicsHandlerUtility::mirrorRectForPosAtIndex(m_rect, new_pos, m_vector_index)); - adjusteHandlerPos(); + adjustHandlerPos(); } /** diff --git a/sources/editor/graphicspart/partellipse.h b/sources/editor/graphicspart/partellipse.h index 8466f9579..3e5093dcc 100644 --- a/sources/editor/graphicspart/partellipse.h +++ b/sources/editor/graphicspart/partellipse.h @@ -56,7 +56,7 @@ class PartEllipse : public AbstractPartEllipse void fromXml (const QDomElement &) override; QPainterPath shape() const override; QPainterPath shadowShape() const override; - void setRect(const QRectF &rect) override {AbstractPartEllipse::setRect(rect); adjusteHandlerPos();} + void setRect(const QRectF &rect) override {AbstractPartEllipse::setRect(rect); adjustHandlerPos();} void addHandler() override; void removeHandler() override; @@ -68,7 +68,7 @@ class PartEllipse : public AbstractPartEllipse private: void switchResizeMode(); - void adjusteHandlerPos(); + void adjustHandlerPos(); void handlerMousePressEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event); void handlerMouseMoveEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event); void handlerMouseReleaseEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event); diff --git a/sources/editor/graphicspart/partline.cpp b/sources/editor/graphicspart/partline.cpp index 0ad0e1e91..c365bbcf4 100644 --- a/sources/editor/graphicspart/partline.cpp +++ b/sources/editor/graphicspart/partline.cpp @@ -164,7 +164,7 @@ QVariant PartLine::itemChange(QGraphicsItem::GraphicsItemChange change, const QV { if (change == ItemPositionHasChanged) { - adjusteHandlerPos(); + adjustHandlerPos(); } else if (change == ItemSceneChange) { @@ -215,10 +215,10 @@ bool PartLine::sceneEventFilter(QGraphicsItem *watched, QEvent *event) } /** - @brief PartLine::adjusteHandlerPos + @brief PartLine::adjustHandlerPos Adjust the position of the handler item */ -void PartLine::adjusteHandlerPos() +void PartLine::adjustHandlerPos() { if(m_handler_vector.isEmpty()) return; @@ -272,7 +272,7 @@ void PartLine::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsScen emit lineChanged(); - adjusteHandlerPos(); + adjustHandlerPos(); } /** @@ -540,7 +540,7 @@ void PartLine::setLine(const QLineF &line) if (m_line == line) return; prepareGeometryChange(); m_line = line; - adjusteHandlerPos(); + adjustHandlerPos(); emit lineChanged(); } diff --git a/sources/editor/graphicspart/partline.h b/sources/editor/graphicspart/partline.h index 0690f26d8..7c72f9475 100644 --- a/sources/editor/graphicspart/partline.h +++ b/sources/editor/graphicspart/partline.h @@ -105,7 +105,7 @@ class PartLine : public CustomElementGraphicPart bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) override; private: - void adjusteHandlerPos(); + void adjustHandlerPos(); void handlerMousePressEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event); void handlerMouseMoveEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event); void handlerMouseReleaseEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event); diff --git a/sources/editor/graphicspart/partpolygon.cpp b/sources/editor/graphicspart/partpolygon.cpp index 08813a359..137c29aad 100644 --- a/sources/editor/graphicspart/partpolygon.cpp +++ b/sources/editor/graphicspart/partpolygon.cpp @@ -219,7 +219,7 @@ void PartPolygon::setPolygon(const QPolygonF &polygon) if (m_polygon == polygon) return; prepareGeometryChange(); m_polygon = polygon; - adjusteHandlerPos(); + adjustHandlerPos(); emit polygonChanged(); } @@ -320,7 +320,7 @@ QVariant PartPolygon::itemChange(QGraphicsItem::GraphicsItemChange change, const { if (change == ItemPositionHasChanged) { - adjusteHandlerPos(); + adjustHandlerPos(); } else if (change == ItemSceneChange) { @@ -395,9 +395,9 @@ void PartPolygon::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) } /** - @brief PartPolygon::adjusteHandlerPos + @brief PartPolygon::adjustHandlerPos */ -void PartPolygon::adjusteHandlerPos() +void PartPolygon::adjustHandlerPos() { if(m_handler_vector.isEmpty()) return; @@ -446,7 +446,7 @@ void PartPolygon::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphicsS prepareGeometryChange(); m_polygon.replace(m_vector_index, new_pos); - adjusteHandlerPos(); + adjustHandlerPos(); emit polygonChanged(); } diff --git a/sources/editor/graphicspart/partpolygon.h b/sources/editor/graphicspart/partpolygon.h index 2a1cb0c2c..2a18524f4 100644 --- a/sources/editor/graphicspart/partpolygon.h +++ b/sources/editor/graphicspart/partpolygon.h @@ -99,7 +99,7 @@ class PartPolygon : public CustomElementGraphicPart void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override; private: - void adjusteHandlerPos(); + void adjustHandlerPos(); void handlerMousePressEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event); void handlerMouseMoveEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event); void handlerMouseReleaseEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event); diff --git a/sources/editor/graphicspart/partrectangle.cpp b/sources/editor/graphicspart/partrectangle.cpp index 6b5e39391..816f56a3e 100644 --- a/sources/editor/graphicspart/partrectangle.cpp +++ b/sources/editor/graphicspart/partrectangle.cpp @@ -147,7 +147,7 @@ void PartRectangle::setRect(const QRectF &rect) if (rect == m_rect) return; prepareGeometryChange(); m_rect = rect; - adjusteHandlerPos(); + adjustHandlerPos(); emit rectChanged(); } @@ -155,7 +155,7 @@ void PartRectangle::setXRadius(qreal X) { m_xRadius = X; update(); - adjusteHandlerPos(); + adjustHandlerPos(); emit XRadiusChanged(); } @@ -163,7 +163,7 @@ void PartRectangle::setYRadius(qreal Y) { m_yRadius = Y; update(); - adjusteHandlerPos(); + adjustHandlerPos(); emit YRadiusChanged(); } @@ -303,7 +303,7 @@ QVariant PartRectangle::itemChange(QGraphicsItem::GraphicsItemChange change, con { if (change == ItemPositionHasChanged) { - adjusteHandlerPos(); + adjustHandlerPos(); } else if (change == ItemSceneChange) { @@ -387,9 +387,9 @@ void PartRectangle::switchResizeMode() } /** - @brief PartRectangle::adjusteHandlerPos + @brief PartRectangle::adjustHandlerPos */ -void PartRectangle::adjusteHandlerPos() +void PartRectangle::adjustHandlerPos() { if (m_handler_vector.isEmpty()) { return; @@ -469,7 +469,7 @@ void PartRectangle::handlerMouseMoveEvent(QetGraphicsHandlerItem *qghi, QGraphic } } - adjusteHandlerPos(); + adjustHandlerPos(); } void PartRectangle::handlerMouseReleaseEvent(QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event) diff --git a/sources/editor/graphicspart/partrectangle.h b/sources/editor/graphicspart/partrectangle.h index 7bd458ab4..e3d3295c0 100644 --- a/sources/editor/graphicspart/partrectangle.h +++ b/sources/editor/graphicspart/partrectangle.h @@ -95,7 +95,7 @@ class PartRectangle : public CustomElementGraphicPart private: void switchResizeMode(); - void adjusteHandlerPos(); + void adjustHandlerPos(); void handlerMousePressEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event); void handlerMouseMoveEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event); void handlerMouseReleaseEvent (QetGraphicsHandlerItem *qghi, QGraphicsSceneMouseEvent *event); diff --git a/sources/qetgraphicsitem/conductor.cpp b/sources/qetgraphicsitem/conductor.cpp index ab22bcbf5..af19847d9 100644 --- a/sources/qetgraphicsitem/conductor.cpp +++ b/sources/qetgraphicsitem/conductor.cpp @@ -203,7 +203,7 @@ void Conductor::segmentsToPath() if (isSelected() && !m_moving_segment) { if(handlerPoints().size() == m_handler_vector.size()) - adjusteHandlerPos(); + adjustHandlerPos(); else { removeHandler(); @@ -718,7 +718,7 @@ QVariant Conductor::itemChange(GraphicsItemChange change, const QVariant &value) calculateTextItemPosition(); } else if (change == QGraphicsItem::ItemPositionHasChanged && isSelected()) { - adjusteHandlerPos(); + adjustHandlerPos(); } return(QGraphicsObject::itemChange(change, value)); @@ -770,10 +770,10 @@ bool Conductor::sceneEventFilter(QGraphicsItem *watched, QEvent *event) } /** - @brief Conductor::adjusteHandlerPos + @brief Conductor::adjustHandlerPos Adjust the position of the handler item */ -void Conductor::adjusteHandlerPos() +void Conductor::adjustHandlerPos() { if (m_handler_vector.isEmpty()) return; diff --git a/sources/qetgraphicsitem/conductor.h b/sources/qetgraphicsitem/conductor.h index 3afab561b..5e862df6d 100644 --- a/sources/qetgraphicsitem/conductor.h +++ b/sources/qetgraphicsitem/conductor.h @@ -164,7 +164,7 @@ class Conductor : public QGraphicsObject QGraphicsItem *watched, QEvent *event) override; private: - void adjusteHandlerPos(); + void adjustHandlerPos(); void handlerMousePressEvent( QetGraphicsHandlerItem *qghi, diff --git a/sources/qetgraphicsitem/qetshapeitem.cpp b/sources/qetgraphicsitem/qetshapeitem.cpp index aaeff3d6e..019133eff 100644 --- a/sources/qetgraphicsitem/qetshapeitem.cpp +++ b/sources/qetgraphicsitem/qetshapeitem.cpp @@ -129,7 +129,7 @@ bool QetShapeItem::setLine(const QLineF &line) prepareGeometryChange(); m_P1 = line.p1(); m_P2 = line.p2(); - adjusteHandlerPos(); + adjustHandlerPos(); return true; } @@ -146,7 +146,7 @@ bool QetShapeItem::setRect(const QRectF &rect) prepareGeometryChange(); m_P1 = rect.topLeft(); m_P2 = rect.bottomRight(); - adjusteHandlerPos(); + adjustHandlerPos(); return true; } @@ -166,7 +166,7 @@ bool QetShapeItem::setPolygon(const QPolygonF &polygon) } prepareGeometryChange(); m_polygon = polygon; - adjusteHandlerPos(); + adjustHandlerPos(); return true; } @@ -189,7 +189,7 @@ void QetShapeItem::setXRadius(qreal X) { m_xRadius = X; update(); - adjusteHandlerPos(); + adjustHandlerPos(); emit XRadiusChanged(); } @@ -197,7 +197,7 @@ void QetShapeItem::setYRadius(qreal Y) { m_yRadius = Y; update(); - adjusteHandlerPos(); + adjustHandlerPos(); emit YRadiusChanged(); } @@ -398,7 +398,7 @@ QVariant QetShapeItem::itemChange(QGraphicsItem::GraphicsItemChange change, } } else if (change == ItemPositionHasChanged) { - adjusteHandlerPos(); + adjustHandlerPos(); } else if (change == ItemSceneHasChanged) { @@ -606,10 +606,10 @@ void QetShapeItem::addHandler() } /** - @brief QetShapeItem::adjusteHandlerPos + @brief QetShapeItem::adjustHandlerPos Adjust the position of the handler item */ -void QetShapeItem::adjusteHandlerPos() +void QetShapeItem::adjustHandlerPos() { if (m_handler_vector.isEmpty()) { return; @@ -737,7 +737,7 @@ void QetShapeItem::handlerMouseMoveEvent(QGraphicsSceneMouseEvent *event) case Line: prepareGeometryChange(); m_vector_index == 0 ? m_P1 = new_pos : m_P2 = new_pos; - adjusteHandlerPos(); + adjustHandlerPos(); break; case Rectangle: @@ -761,7 +761,7 @@ void QetShapeItem::handlerMouseMoveEvent(QGraphicsSceneMouseEvent *event) else { setYRadius(radius); } - adjusteHandlerPos(); + adjustHandlerPos(); break; } case Ellipse: @@ -777,7 +777,7 @@ void QetShapeItem::handlerMouseMoveEvent(QGraphicsSceneMouseEvent *event) case Polygon: prepareGeometryChange(); m_polygon.replace(m_vector_index, new_pos); - adjusteHandlerPos(); + adjustHandlerPos(); break; } //End switch } diff --git a/sources/qetgraphicsitem/qetshapeitem.h b/sources/qetgraphicsitem/qetshapeitem.h index aa205f253..f40f4aed5 100644 --- a/sources/qetgraphicsitem/qetshapeitem.h +++ b/sources/qetgraphicsitem/qetshapeitem.h @@ -130,7 +130,7 @@ class QetShapeItem : public QetGraphicsItem private: void switchResizeMode(); void addHandler(); - void adjusteHandlerPos(); + void adjustHandlerPos(); void insertPoint(); void removePoint(); From a4a3733670164244b8c1d429cc91b85598568936 Mon Sep 17 00:00:00 2001 From: plc-user <74435298+plc-user@users.noreply.github.com> Date: Fri, 14 Feb 2025 16:59:23 +0100 Subject: [PATCH 2/2] typos, whitespace and brackets --- sources/qetgraphicsitem/ViewItem/qetgraphicstableitem.cpp | 5 +++-- sources/qetgraphicsitem/element.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sources/qetgraphicsitem/ViewItem/qetgraphicstableitem.cpp b/sources/qetgraphicsitem/ViewItem/qetgraphicstableitem.cpp index 208450a06..076ba5c95 100644 --- a/sources/qetgraphicsitem/ViewItem/qetgraphicstableitem.cpp +++ b/sources/qetgraphicsitem/ViewItem/qetgraphicstableitem.cpp @@ -58,9 +58,10 @@ void QetGraphicsTableItem::adjustTableToFolio( auto size_ = table->size(); size_.setWidth(int(drawable_rect.width() - (margins.left() + margins.right()))); - //Size must be a multiple of 10, because the table adjust itself by step of 10. + //Size must be a multiple of 10, because the table adjusts itself by step of 10. while (size_.width()%10) { - --size_.rwidth(); } + --size_.rwidth(); + } table->setSize(size_); //Calculate the maximum row to display to fit the nomenclature into diagram diff --git a/sources/qetgraphicsitem/element.cpp b/sources/qetgraphicsitem/element.cpp index 8a20472e6..86d3a5dc8 100644 --- a/sources/qetgraphicsitem/element.cpp +++ b/sources/qetgraphicsitem/element.cpp @@ -805,13 +805,13 @@ bool Element::fromXml(QDomElement &e, // orientation bool conv_ok; int read_ori = e.attribute(QStringLiteral("orientation")).toInt(&conv_ok); - if (!conv_ok || read_ori < 0 || read_ori > 3) { + if (!(conv_ok) || (read_ori < 0) || (read_ori > 3)) { read_ori = 0; } setRotation(90*read_ori); //Before loading the dynamic text field, - //we remove the dynamic text field created from the description of this element, to avoid doublons. + //we remove the dynamic text field created from the description of this element, to avoid doubles. for(DynamicElementTextItem *deti : m_dynamic_text_list) delete deti; m_dynamic_text_list.clear();