From 951e8baf195036937bfda6a0cf36f4e7b4d7fbff Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Sun, 22 Jun 2025 17:03:55 -0500 Subject: [PATCH 01/10] Gui: Implicit capture of this is deprecated --- src/Gui/MainWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index 0c3a9068bc..20d1ba7c98 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -451,7 +451,7 @@ MainWindow::MainWindow(QWidget * parent, Qt::WindowFlags f) this, &MainWindow::onSetActiveSubWindow); #else connect(d->windowMapper, &QSignalMapper::mappedObject, - this, [=](QObject* object) { + this, [=, this](QObject* object) { onSetActiveSubWindow(qobject_cast(object)); }); #endif From f8ba2f6615d5dd0bec2ec266438274bba18aecb9 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Sun, 22 Jun 2025 17:06:51 -0500 Subject: [PATCH 02/10] Gui: Mark widget as [[maybe_unused]] --- src/Gui/CommandView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 91ee820349..c657289ee7 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -2686,7 +2686,7 @@ public: currentSelectionHandler = nullptr; } - static QCursor makeCursor(QWidget* widget, const QSize& size, const char* svgFile, int hotX, int hotY) + static QCursor makeCursor([[maybe_unused]] QWidget* widget, const QSize& size, const char* svgFile, int hotX, int hotY) { qreal hotXF = hotX; qreal hotYF = hotY; From edca310fd359dc800f305ea5f58c1ae334e68eef Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Sun, 22 Jun 2025 17:11:22 -0500 Subject: [PATCH 03/10] Gui: Make narrowing conversion float->int explicit --- src/Gui/CommandView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index c657289ee7..26eb5434fc 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -2698,7 +2698,7 @@ public: } #endif QPixmap px(Gui::BitmapFactory().pixmapFromSvg(svgFile, size)); - return QCursor(px, hotXF, hotYF); + return QCursor(px, static_cast(hotXF), static_cast(hotYF)); } }; } From aa0acc944f759c8ed8d192ef8c6067a1397c601c Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Sun, 22 Jun 2025 17:40:25 -0500 Subject: [PATCH 04/10] Gui: Drop name of unused parameter in PropertyBoolItem --- src/Gui/propertyeditor/PropertyItem.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Gui/propertyeditor/PropertyItem.cpp b/src/Gui/propertyeditor/PropertyItem.cpp index 4bf7a42bb1..f8df0c3a41 100644 --- a/src/Gui/propertyeditor/PropertyItem.cpp +++ b/src/Gui/propertyeditor/PropertyItem.cpp @@ -1376,9 +1376,11 @@ void PropertyBoolItem::setValue(const QVariant& value) } QWidget* PropertyBoolItem::createEditor(QWidget* parent, - const std::function& method, + const std::function& /*method*/, FrameOption /*frameOption*/) const { + // The checkbox is basically artificial (it is not rendered). Other code handles the callback, + // etc. auto checkbox = new QCheckBox(parent); return checkbox; } From 385afbdc8bdb878034c8d3eff1a11dd841b9e6ea Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Sun, 22 Jun 2025 18:09:57 -0500 Subject: [PATCH 05/10] CAM: Add initializer for retract_mode Also explicitly list fields for clarity. --- src/Mod/CAM/PathSimulator/AppGL/MillSimulation.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Mod/CAM/PathSimulator/AppGL/MillSimulation.h b/src/Mod/CAM/PathSimulator/AppGL/MillSimulation.h index a4ba8830a0..b3bade05ec 100644 --- a/src/Mod/CAM/PathSimulator/AppGL/MillSimulation.h +++ b/src/Mod/CAM/PathSimulator/AppGL/MillSimulation.h @@ -107,9 +107,11 @@ protected: std::vector MillPathSegments; std::ostringstream mFpsStream; - MillMotion mZeroPos = {eNop, -1, 0, 0, 100, 0, 0, 0, 0}; - MillMotion mCurMotion = {eNop, -1, 0, 0, 0, 0, 0, 0, 0}; - MillMotion mDestMotion = {eNop, -1, 0, 0, 0, 0, 0, 0, 0}; + // clang-format off + MillMotion mZeroPos = {.cmd=eNop, .tool=-1, .x=0, .y=0, .z=100, .i=0, .j=0, .k=0, .r=0, .retract_mode='\0', .retract_z=0.0}; + MillMotion mCurMotion = {.cmd=eNop, .tool=-1, .x=0, .y=0, .z=0, .i=0, .j=0, .k=0, .r=0, .retract_mode='\0', .retract_z=0.0}; + MillMotion mDestMotion = {.cmd=eNop, .tool=-1, .x=0, .y=0, .z=0, .i=0, .j=0, .k=0, .r=0, .retract_mode='\0', .retract_z=0.0}; + // clang-format on StockObject mStockObject; SolidObject mBaseShape; From fdfd3e0eaa3fec5d82cc72dc0e506b366bf7674a Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Sun, 22 Jun 2025 18:32:07 -0500 Subject: [PATCH 06/10] CAM: Add missing initializers Also switch to designated initializers to give context. --- .../CAM/PathSimulator/AppGL/GuiDisplay.cpp | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/Mod/CAM/PathSimulator/AppGL/GuiDisplay.cpp b/src/Mod/CAM/PathSimulator/AppGL/GuiDisplay.cpp index 1bdd249010..2a9241b4d0 100644 --- a/src/Mod/CAM/PathSimulator/AppGL/GuiDisplay.cpp +++ b/src/Mod/CAM/PathSimulator/AppGL/GuiDisplay.cpp @@ -31,26 +31,28 @@ using namespace MillSim; +// clang-format off GuiItem guiItems[] = { - {eGuiItemSlider, 0, 0, 28, -80, 0}, - {eGuiItemThumb, 0, 0, 328, -94, 1}, - {eGuiItemPause, 0, 0, 28, -50, 'P', true}, - {eGuiItemPlay, 0, 0, 28, -50, 'S', false}, - {eGuiItemSingleStep, 0, 0, 68, -50, 'T'}, - {eGuiItemSlower, 0, 0, 113, -50, ' '}, - {eGuiItemFaster, 0, 0, 158, -50, 'F'}, - {eGuiItemX, 0, 0, 208, -45, 0, false, 0}, - {eGuiItem1, 0, 0, 230, -50, 0, false, 0}, - {eGuiItem5, 0, 0, 230, -50, 0, true, 0}, - {eGuiItem10, 0, 0, 230, -50, 0, true, 0}, - {eGuiItem25, 0, 0, 230, -50, 0, true, 0}, - {eGuiItem50, 0, 0, 230, -50, 0, true, 0}, - {eGuiItemRotate, 0, 0, -140, -50, ' ', false, GUIITEM_CHECKABLE}, - {eGuiItemPath, 0, 0, -100, -50, 'L', false, GUIITEM_CHECKABLE}, - {eGuiItemAmbientOclusion, 0, 0, -60, -50, 'A', false, GUIITEM_CHECKABLE}, - {eGuiItemView, 0, 0, -180, -50, 'V', false}, - {eGuiItemHome, 0, 0, -220, -50, 'H'}, + {.name=eGuiItemSlider, .vbo=0, .vao=0, .sx=28, .sy=-80, .actionKey=0, .hidden=false, .flags=0}, + {.name=eGuiItemThumb, .vbo=0, .vao=0, .sx=328, .sy=-94, .actionKey=1, .hidden=false, .flags=0}, + {.name=eGuiItemPause, .vbo=0, .vao=0, .sx=28, .sy=-50, .actionKey='P', .hidden=true, .flags=0}, + {.name=eGuiItemPlay, .vbo=0, .vao=0, .sx=28, .sy=-50, .actionKey='S', .hidden=false, .flags=0}, + {.name=eGuiItemSingleStep, .vbo=0, .vao=0, .sx=68, .sy=-50, .actionKey='T', .hidden=false, .flags=0}, + {.name=eGuiItemSlower, .vbo=0, .vao=0, .sx=113, .sy=-50, .actionKey=' ', .hidden=false, .flags=0}, + {.name=eGuiItemFaster, .vbo=0, .vao=0, .sx=158, .sy=-50, .actionKey='F', .hidden=false, .flags=0}, + {.name=eGuiItemX, .vbo=0, .vao=0, .sx=208, .sy=-45, .actionKey=0, .hidden=false, .flags=0}, + {.name=eGuiItem1, .vbo=0, .vao=0, .sx=230, .sy=-50, .actionKey=0, .hidden=false, .flags=0}, + {.name=eGuiItem5, .vbo=0, .vao=0, .sx=230, .sy=-50, .actionKey=0, .hidden=true, .flags=0}, + {.name=eGuiItem10, .vbo=0, .vao=0, .sx=230, .sy=-50, .actionKey=0, .hidden=true, .flags=0}, + {.name=eGuiItem25, .vbo=0, .vao=0, .sx=230, .sy=-50, .actionKey=0, .hidden=true, .flags=0}, + {.name=eGuiItem50, .vbo=0, .vao=0, .sx=230, .sy=-50, .actionKey=0, .hidden=true, .flags=0}, + {.name=eGuiItemRotate, .vbo=0, .vao=0, .sx=-140, .sy=-50, .actionKey=' ', .hidden=false, .flags=GUIITEM_CHECKABLE}, + {.name=eGuiItemPath, .vbo=0, .vao=0, .sx=-100, .sy=-50, .actionKey='L', .hidden=false, .flags=GUIITEM_CHECKABLE}, + {.name=eGuiItemAmbientOclusion, .vbo=0, .vao=0, .sx=-60, .sy=-50, .actionKey='A', .hidden=false, .flags=GUIITEM_CHECKABLE}, + {.name=eGuiItemView, .vbo=0, .vao=0, .sx=-180, .sy=-50, .actionKey='V', .hidden=false, .flags=0}, + {.name=eGuiItemHome, .vbo=0, .vao=0, .sx=-220, .sy=-50, .actionKey='H', .hidden=false, .flags=0}, }; +// clang-format on #define NUM_GUI_ITEMS (sizeof(guiItems) / sizeof(GuiItem)) #define TEX_SIZE 256 From 41af5a8e74f6c858a74492655c1eeb7027ebef36 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Sun, 22 Jun 2025 18:35:21 -0500 Subject: [PATCH 07/10] TD: Add missing override --- src/Mod/TechDraw/Gui/ViewProviderViewPart.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/TechDraw/Gui/ViewProviderViewPart.h b/src/Mod/TechDraw/Gui/ViewProviderViewPart.h index d19137e349..171126483a 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderViewPart.h +++ b/src/Mod/TechDraw/Gui/ViewProviderViewPart.h @@ -79,7 +79,7 @@ public: int prefHighlightStyle(void); std::vector claimChildren(void) const override; - void fixSceneDependencies(); + void fixSceneDependencies() override; TechDraw::DrawViewPart* getViewObject() const override; TechDraw::DrawViewPart* getViewPart() const; From d2ce7f81450fe36a2fb0b2a08b8094c778ece6d0 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Sun, 22 Jun 2025 18:57:39 -0500 Subject: [PATCH 08/10] TD: Remove calls to now-empty clearLineSets() method --- src/Mod/TechDraw/Gui/QGIViewPart.cpp | 1 - src/Mod/TechDraw/Gui/QGIViewSection.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/src/Mod/TechDraw/Gui/QGIViewPart.cpp b/src/Mod/TechDraw/Gui/QGIViewPart.cpp index 095fa93f14..1f3709d6b5 100644 --- a/src/Mod/TechDraw/Gui/QGIViewPart.cpp +++ b/src/Mod/TechDraw/Gui/QGIViewPart.cpp @@ -287,7 +287,6 @@ void QGIViewPart::drawAllFaces(void) std::vector lineSets = fGeom->getTrimmedLines(iFace); if (!lineSets.empty()) { // this face has geometric hatch lines - newFace->clearLineSets(); for (auto& ls : lineSets) { newFace->addLineSet(ls); } diff --git a/src/Mod/TechDraw/Gui/QGIViewSection.cpp b/src/Mod/TechDraw/Gui/QGIViewSection.cpp index 147ca1a16e..d11515a615 100644 --- a/src/Mod/TechDraw/Gui/QGIViewSection.cpp +++ b/src/Mod/TechDraw/Gui/QGIViewSection.cpp @@ -112,7 +112,6 @@ void QGIViewSection::drawSectionFace() newFace->setLineWeight(sectionVp->WeightPattern.getValue()); std::vector lineSets = section->getDrawableLines(i); if (!lineSets.empty()) { - newFace->clearLineSets(); for (auto& ls: lineSets) { newFace->addLineSet(ls); } From 111d44b71c644e5d051676c1625448d87e05c03b Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Sun, 22 Jun 2025 18:59:45 -0500 Subject: [PATCH 09/10] FEM: Eliminate unused proxy member --- src/Mod/Fem/Gui/TaskPostBoxes.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Mod/Fem/Gui/TaskPostBoxes.h b/src/Mod/Fem/Gui/TaskPostBoxes.h index d37742dd27..6b1f38c6df 100644 --- a/src/Mod/Fem/Gui/TaskPostBoxes.h +++ b/src/Mod/Fem/Gui/TaskPostBoxes.h @@ -577,7 +577,6 @@ private: void onOperatorsActivated(int index); private: - QWidget* proxy; std::unique_ptr ui; }; From 507e170b19d5297943c3632ce1eb7795262d5a1b Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Sun, 29 Jun 2025 04:47:28 -0500 Subject: [PATCH 10/10] Apply suggestions from code review Co-authored-by: Kacper Donat --- src/Mod/CAM/PathSimulator/AppGL/GuiDisplay.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Mod/CAM/PathSimulator/AppGL/GuiDisplay.cpp b/src/Mod/CAM/PathSimulator/AppGL/GuiDisplay.cpp index 2a9241b4d0..24ce02f1f1 100644 --- a/src/Mod/CAM/PathSimulator/AppGL/GuiDisplay.cpp +++ b/src/Mod/CAM/PathSimulator/AppGL/GuiDisplay.cpp @@ -32,6 +32,7 @@ using namespace MillSim; // clang-format off +// NOLINTBEGIN(*-magic-numbers) GuiItem guiItems[] = { {.name=eGuiItemSlider, .vbo=0, .vao=0, .sx=28, .sy=-80, .actionKey=0, .hidden=false, .flags=0}, {.name=eGuiItemThumb, .vbo=0, .vao=0, .sx=328, .sy=-94, .actionKey=1, .hidden=false, .flags=0}, @@ -52,6 +53,7 @@ GuiItem guiItems[] = { {.name=eGuiItemView, .vbo=0, .vao=0, .sx=-180, .sy=-50, .actionKey='V', .hidden=false, .flags=0}, {.name=eGuiItemHome, .vbo=0, .vao=0, .sx=-220, .sy=-50, .actionKey='H', .hidden=false, .flags=0}, }; +// NOLINTEND(*-magic-numbers) // clang-format on #define NUM_GUI_ITEMS (sizeof(guiItems) / sizeof(GuiItem))