diff --git a/src/Mod/TechDraw/App/DrawComplexSection.cpp b/src/Mod/TechDraw/App/DrawComplexSection.cpp index 60d11c4873..bd30eef7a4 100644 --- a/src/Mod/TechDraw/App/DrawComplexSection.cpp +++ b/src/Mod/TechDraw/App/DrawComplexSection.cpp @@ -1567,17 +1567,16 @@ DrawComplexSection::findNormalForFace(const TopoDS_Face& face, const std::vector>& normalKV, const std::vector& segmentEdges) { - size_t index = getSegmentIndex(face, segmentEdges); - if (index < 0 || - index >= segmentEdges.size()) { //NOLINT + int index = getSegmentIndex(face, segmentEdges); + if (index < 0) { throw Base::RuntimeError("DCS::findNormalForFace - did not find normal for face!"); } for (auto& keyValue : normalKV) { - if (static_cast(keyValue.first) == index) { + if (keyValue.first == index) { return keyValue; } } - throw Base::RuntimeError("DCS::findNormalForFace - no keyValue pair for segment!"); + throw Base::RuntimeError("DCS::findNormalForFace - no keyValue pair for segment!"); } diff --git a/src/Mod/TechDraw/Gui/QGIRichAnno.cpp b/src/Mod/TechDraw/Gui/QGIRichAnno.cpp index c534ec77ed..b8dd5c6ca7 100644 --- a/src/Mod/TechDraw/Gui/QGIRichAnno.cpp +++ b/src/Mod/TechDraw/Gui/QGIRichAnno.cpp @@ -209,7 +209,7 @@ void QGIRichAnno::setTextItem() } if (m_isEditing) { - Q_EMIT positionChanged(scenePos()); + Q_EMIT positionChanged(); } } @@ -477,7 +477,7 @@ void QGIRichAnno::mouseMoveEvent(QGraphicsSceneMouseEvent* event) QTimer::singleShot(0, this, [this]() { if (this && scene()) { - Q_EMIT positionChanged(scenePos()); + Q_EMIT positionChanged(); } }); @@ -508,7 +508,7 @@ void QGIRichAnno::mouseReleaseEvent(QGraphicsSceneMouseEvent* event) // Ensure focus returns to the text item after the resize handle is released refocusAnnotation(); - Q_EMIT positionChanged(scenePos()); + Q_EMIT positionChanged(); if (!isUnderMouse()) { QGraphicsSceneHoverEvent leaveEvent(QEvent::GraphicsSceneHoverLeave); @@ -585,7 +585,7 @@ void QGIRichAnno::setEditMode(bool enable) refocusAnnotation(); - Q_EMIT positionChanged(scenePos()); + Q_EMIT positionChanged(); } else { m_text->setTextInteractionFlags(Qt::NoTextInteraction); @@ -637,7 +637,7 @@ QVariant QGIRichAnno::itemChange(GraphicsItemChange change, const QVariant& valu { if (change == QGraphicsItem::ItemScenePositionHasChanged && scene()) { - Q_EMIT positionChanged(scenePos()); + Q_EMIT positionChanged(); } return QGIView::itemChange(change, value); } @@ -661,7 +661,7 @@ void QGIRichAnno::updateLayout() update(); if (scene()) { - Q_EMIT positionChanged(scenePos()); + Q_EMIT positionChanged(); } drawBorder(); } diff --git a/src/Mod/TechDraw/Gui/QGIRichAnno.h b/src/Mod/TechDraw/Gui/QGIRichAnno.h index c818e0078d..29bde5e9fa 100644 --- a/src/Mod/TechDraw/Gui/QGIRichAnno.h +++ b/src/Mod/TechDraw/Gui/QGIRichAnno.h @@ -113,7 +113,7 @@ public: void widthChanged(); void textChanged(); void selectionChanged(); - void positionChanged(const QPointF& scenePos); + void positionChanged(); protected: void draw() override; @@ -154,4 +154,4 @@ private Q_SLOTS: void onContentsChanged(); }; -} \ No newline at end of file +} diff --git a/src/Mod/TechDraw/Gui/TaskRichAnno.cpp b/src/Mod/TechDraw/Gui/TaskRichAnno.cpp index aa073e129e..d55f22a984 100644 --- a/src/Mod/TechDraw/Gui/TaskRichAnno.cpp +++ b/src/Mod/TechDraw/Gui/TaskRichAnno.cpp @@ -303,7 +303,7 @@ void TaskRichAnno::onViewTransformed() // When the view pans, the item's scene position hasn't changed. // We just need to re-run the position calculation with its current scenePos. if (m_qgiAnno) { - onViewPositionChanged(m_qgiAnno->scenePos()); + onViewPositionChanged(); } } @@ -326,7 +326,7 @@ void TaskRichAnno::onViewSelectionChanged() } -void TaskRichAnno::onViewPositionChanged(const QPointF& scenePos) +void TaskRichAnno::onViewPositionChanged() { // Make sure you have a local variable for the QGVPage to make the code cleaner QGVPage* graphicsView = nullptr; diff --git a/src/Mod/TechDraw/Gui/TaskRichAnno.h b/src/Mod/TechDraw/Gui/TaskRichAnno.h index c80544fae6..0efed92c8e 100644 --- a/src/Mod/TechDraw/Gui/TaskRichAnno.h +++ b/src/Mod/TechDraw/Gui/TaskRichAnno.h @@ -99,7 +99,7 @@ protected Q_SLOTS: void refocusAnnotation(); void onViewSelectionChanged(); - void onViewPositionChanged(const QPointF& scenePos); + void onViewPositionChanged(); private: void removeViewFilter(); @@ -168,4 +168,4 @@ private: Gui::TaskView::TaskBox* taskbox; }; -} //namespace TechDrawGui \ No newline at end of file +} //namespace TechDrawGui diff --git a/src/Mod/TechDraw/Gui/mrichtextedit.cpp b/src/Mod/TechDraw/Gui/mrichtextedit.cpp index 8fb480ad1f..4fad590fa0 100644 --- a/src/Mod/TechDraw/Gui/mrichtextedit.cpp +++ b/src/Mod/TechDraw/Gui/mrichtextedit.cpp @@ -819,7 +819,7 @@ void MRichTextEdit::addFontSize(QString fontSize) } // 2. Check if the new size is already in the list (using fuzzy comparison for doubles) - for (double existingSize : qAsConst(sizes)) { + for (double existingSize : std::as_const(sizes)) { if (qFuzzyCompare(existingSize, newSize)) { // Already exists, just make sure it's the current text f_fontsize->setCurrentText(QString::number(newSize, 'g', 4)); @@ -833,7 +833,7 @@ void MRichTextEdit::addFontSize(QString fontSize) // 4. Repopulate the combobox with the sorted, correctly formatted list QStringList newList; - for (double size : qAsConst(sizes)) { + for (double size : std::as_const(sizes)) { newList << QString::number(size, 'g', 4); }