diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 91ee820349..26eb5434fc 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; @@ -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)); } }; } 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 diff --git a/src/Gui/propertyeditor/PropertyItem.cpp b/src/Gui/propertyeditor/PropertyItem.cpp index 69e3c5b5eb..f8df0c3a41 100644 --- a/src/Gui/propertyeditor/PropertyItem.cpp +++ b/src/Gui/propertyeditor/PropertyItem.cpp @@ -1379,6 +1379,8 @@ QWidget* PropertyBoolItem::createEditor(QWidget* parent, 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; } diff --git a/src/Mod/CAM/PathSimulator/AppGL/GuiDisplay.cpp b/src/Mod/CAM/PathSimulator/AppGL/GuiDisplay.cpp index 1bdd249010..24ce02f1f1 100644 --- a/src/Mod/CAM/PathSimulator/AppGL/GuiDisplay.cpp +++ b/src/Mod/CAM/PathSimulator/AppGL/GuiDisplay.cpp @@ -31,26 +31,30 @@ using namespace MillSim; +// clang-format off +// NOLINTBEGIN(*-magic-numbers) 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}, }; +// NOLINTEND(*-magic-numbers) +// clang-format on #define NUM_GUI_ITEMS (sizeof(guiItems) / sizeof(GuiItem)) #define TEX_SIZE 256 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; diff --git a/src/Mod/Fem/Gui/TaskPostBoxes.h b/src/Mod/Fem/Gui/TaskPostBoxes.h index 816dafb080..1303323898 100644 --- a/src/Mod/Fem/Gui/TaskPostBoxes.h +++ b/src/Mod/Fem/Gui/TaskPostBoxes.h @@ -593,7 +593,6 @@ private: void onOperatorsActivated(int index); private: - QWidget* proxy; std::unique_ptr ui; }; diff --git a/src/Mod/TechDraw/Gui/QGIViewPart.cpp b/src/Mod/TechDraw/Gui/QGIViewPart.cpp index 8f2a7cafc3..d148de2f9c 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); } diff --git a/src/Mod/TechDraw/Gui/ViewProviderViewPart.h b/src/Mod/TechDraw/Gui/ViewProviderViewPart.h index 2d9b89ab0c..7ceeec9cbf 100644 --- a/src/Mod/TechDraw/Gui/ViewProviderViewPart.h +++ b/src/Mod/TechDraw/Gui/ViewProviderViewPart.h @@ -80,7 +80,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;