diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index 2bdf781c7a..eba0f11426 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -170,11 +170,7 @@ public: // Pimpl class struct ApplicationP { - explicit ApplicationP(bool GUIenabled) : - activeDocument(nullptr), - editDocument(nullptr), - isClosing(false), - startingUp(true) + explicit ApplicationP(bool GUIenabled) { // create the macro manager if (GUIenabled) @@ -195,14 +191,14 @@ struct ApplicationP /// list of all handled documents std::map documents; /// Active document - Gui::Document* activeDocument; - Gui::Document* editDocument; + Gui::Document* activeDocument{nullptr}; + Gui::Document* editDocument{nullptr}; MacroManager* macroMngr; PreferencePackManager* prefPackManager; /// List of all registered views std::list passive; - bool isClosing; - bool startingUp; + bool isClosing{false}; + bool startingUp{true}; /// Handles all commands CommandManager commandManager; ViewProviderMap viewproviderMap; diff --git a/src/Gui/AxisOrigin.cpp b/src/Gui/AxisOrigin.cpp index 7851dc66d8..397f4b2b39 100644 --- a/src/Gui/AxisOrigin.cpp +++ b/src/Gui/AxisOrigin.cpp @@ -45,10 +45,7 @@ using namespace Gui; TYPESYSTEM_SOURCE(Gui::AxisOrigin,Base::BaseClass) -AxisOrigin::AxisOrigin() - :size(6),pSize(4),dist(2),scale(1),lineSize(2),pointSize(4) -{ -} +AxisOrigin::AxisOrigin() = default; SoGroup *AxisOrigin::getNode() { if(node) diff --git a/src/Gui/AxisOrigin.h b/src/Gui/AxisOrigin.h index 33111e0208..c6aea015ea 100644 --- a/src/Gui/AxisOrigin.h +++ b/src/Gui/AxisOrigin.h @@ -93,12 +93,12 @@ public: bool getDetailPath(const char *subname, SoFullPath *pPath, SoDetail *&det) const; private: - float size; - float pSize; - float dist; - float scale; - float lineSize; - float pointSize; + float size = 6; + float pSize = 4; + float dist = 2; + float scale = 1; + float lineSize = 2; + float pointSize = 4; std::map labels; CoinPtr node; std::map > nodeMap; diff --git a/src/Gui/CallTips.h b/src/Gui/CallTips.h index 259a2708b0..04473b074a 100644 --- a/src/Gui/CallTips.h +++ b/src/Gui/CallTips.h @@ -38,11 +38,10 @@ class CallTip { public: enum Type {Unknown, Module, Class, Method, Member, Property}; - CallTip():type(Unknown) {} QString name; QString description; QString parameter; - Type type; + Type type{Unknown}; }; /** diff --git a/src/Gui/Clipping.cpp b/src/Gui/Clipping.cpp index 76d075a138..8238a04f67 100644 --- a/src/Gui/Clipping.cpp +++ b/src/Gui/Clipping.cpp @@ -48,11 +48,11 @@ public: SoClipPlane* clipY; SoClipPlane* clipZ; SoClipPlane* clipView; - bool flipX; - bool flipY; - bool flipZ; + bool flipX{false}; + bool flipY{false}; + bool flipZ{false}; SoTimerSensor* sensor; - Private() : flipX(false), flipY(false), flipZ(false) + Private() { clipX = new SoClipPlane(); clipX->on.setValue(false); diff --git a/src/Gui/CommandDoc.cpp b/src/Gui/CommandDoc.cpp index adb54d64ff..d0eb36a282 100644 --- a/src/Gui/CommandDoc.cpp +++ b/src/Gui/CommandDoc.cpp @@ -1681,10 +1681,6 @@ class StdCmdExpression : public Gui::Command { public: StdCmdExpression() : Command("Std_Expressions") - , pcActionCopyAll(nullptr) - , pcActionCopySel(nullptr) - , pcActionCopyActive(nullptr) - , pcActionPaste(nullptr) { sGroup = "Edit"; sMenuText = QT_TR_NOOP("Expression actions"); @@ -1887,10 +1883,10 @@ protected: return true; } - QAction *pcActionCopyAll; - QAction *pcActionCopySel; - QAction *pcActionCopyActive; - QAction *pcActionPaste; + QAction *pcActionCopyAll{nullptr}; + QAction *pcActionCopySel{nullptr}; + QAction *pcActionCopyActive{nullptr}; + QAction *pcActionPaste{nullptr}; }; namespace Gui { diff --git a/src/Gui/CommandTest.cpp b/src/Gui/CommandTest.cpp index 21014a228d..0a86fa47a7 100644 --- a/src/Gui/CommandTest.cpp +++ b/src/Gui/CommandTest.cpp @@ -722,10 +722,12 @@ class TestConsoleObserver : public Base::ILogger { QMutex mutex; public: - int matchMsg, matchWrn, matchErr, matchLog, matchCritical; - TestConsoleObserver() : matchMsg(0), matchWrn(0), matchErr(0), matchLog(0), matchCritical(0) - { - } + int matchMsg{0}; + int matchWrn{0}; + int matchErr{0}; + int matchLog{0}; + int matchCritical{0}; + TestConsoleObserver() = default; void SendLog(const std::string& notifiername, const std::string& msg, Base::LogStyle level, Base::IntendedRecipient recipient, Base::ContentType content) override{ diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index c5af7a1f10..2ad6a44e85 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -305,24 +305,17 @@ private: void onRestoreViews(); private: - const int maxViews; - int savedViews; - int offset; - QAction* saveView; - QAction* freezeView; - QAction* clearView; - QAction* separator; + const int maxViews{50}; + int savedViews{0}; + int offset{0}; + QAction* saveView{nullptr}; + QAction* freezeView{nullptr}; + QAction* clearView{nullptr}; + QAction* separator{nullptr}; }; StdCmdFreezeViews::StdCmdFreezeViews() : Command("Std_FreezeViews") - , maxViews(50) - , savedViews(0) - , offset(0) - , saveView(nullptr) - , freezeView(nullptr) - , clearView(nullptr) - , separator(nullptr) { sGroup = "Standard-View"; sMenuText = QT_TR_NOOP("Freeze display"); diff --git a/src/Gui/DAGView/DAGFilter.cpp b/src/Gui/DAGView/DAGFilter.cpp index 66bf9de621..57bc3915af 100644 --- a/src/Gui/DAGView/DAGFilter.cpp +++ b/src/Gui/DAGView/DAGFilter.cpp @@ -31,7 +31,7 @@ using namespace Gui; using namespace DAG; -FilterBase::FilterBase() : name(QString::fromLatin1("empty name")), enabled(true), type(Type::Exclusion) +FilterBase::FilterBase() : name(QString::fromLatin1("empty name")) { } diff --git a/src/Gui/DAGView/DAGFilter.h b/src/Gui/DAGView/DAGFilter.h index 9b78af7308..788bc61899 100644 --- a/src/Gui/DAGView/DAGFilter.h +++ b/src/Gui/DAGView/DAGFilter.h @@ -45,8 +45,8 @@ namespace Gui //! @return is whether we have a match or not. virtual bool goFilter(const Vertex &vertexIn, const Graph &graphIn, const GraphLinkContainer &linkIn) const = 0; QString name; - bool enabled; - Type type; + bool enabled = true; + Type type = Type::Exclusion; }; /*! Hide all children of app::origin that are not diff --git a/src/Gui/DAGView/DAGModelGraph.cpp b/src/Gui/DAGView/DAGModelGraph.cpp index 86c29bec51..f57171c3a9 100644 --- a/src/Gui/DAGView/DAGModelGraph.cpp +++ b/src/Gui/DAGView/DAGModelGraph.cpp @@ -34,13 +34,7 @@ VertexProperty::VertexProperty() : visibleIcon(new QGraphicsPixmapItem()), stateIcon(new QGraphicsPixmapItem()), icon(new QGraphicsPixmapItem()), - text(new QGraphicsTextItem()), - row(0), - column(0), - topoSortIndex(0), - lastVisibleState(VisibilityState::None), - lastFeatureState(FeatureState::None), - dagVisible(true) + text(new QGraphicsTextItem()) { //set z values. this->rectangle->setZValue(-1000.0); @@ -51,10 +45,7 @@ VertexProperty::VertexProperty() : this->text->setZValue(0.0); } -EdgeProperty::EdgeProperty() : relation(BranchTag::None) -{ - -} +EdgeProperty::EdgeProperty() = default; bool Gui::DAG::hasRecord(const App::DocumentObject* dObjectIn, const GraphLinkContainer &containerIn) { diff --git a/src/Gui/DAGView/DAGModelGraph.h b/src/Gui/DAGView/DAGModelGraph.h index e4b65c9363..27d0641e28 100644 --- a/src/Gui/DAGView/DAGModelGraph.h +++ b/src/Gui/DAGView/DAGModelGraph.h @@ -82,12 +82,12 @@ namespace Gui std::shared_ptr icon; //!< icon std::shared_ptr text; //!< text boost::signals2::connection connChangeIcon; - int row; //!< row for this entry. - ColumnMask column; //!< column number containing the point. - int topoSortIndex; - VisibilityState lastVisibleState; //!< visibility test. - FeatureState lastFeatureState; //!< feature state test. - bool dagVisible; //!< should entry be visible in the DAG view. + int row = 0; //!< row for this entry. + ColumnMask column = 0; //!< column number containing the point. + int topoSortIndex = 0; + VisibilityState lastVisibleState = VisibilityState::None; //!< visibility test. + FeatureState lastFeatureState = FeatureState::None; //!< feature state test. + bool dagVisible = true; //!< should entry be visible in the DAG view. }; /*! @brief boost data for each vertex. * @@ -114,7 +114,7 @@ namespace Gui Terminate //!< terminate a branch. }; EdgeProperty(); - BranchTag relation; + BranchTag relation = BranchTag::None; std::shared_ptr connector; //!< line representing link between nodes. }; /*! @brief needed to create an internal index for graph edges. needed for setS.*/ diff --git a/src/Gui/DlgCheckableMessageBox.cpp b/src/Gui/DlgCheckableMessageBox.cpp index c4d206969b..7954190ffd 100644 --- a/src/Gui/DlgCheckableMessageBox.cpp +++ b/src/Gui/DlgCheckableMessageBox.cpp @@ -105,10 +105,10 @@ void DlgCheckableMessageBox::showMessage(const QString& header, const QString& m } struct DlgCheckableMessageBoxPrivate { - DlgCheckableMessageBoxPrivate() : clickedButton(nullptr) {} + DlgCheckableMessageBoxPrivate() = default; Ui::DlgCheckableMessageBox ui; - QAbstractButton *clickedButton; + QAbstractButton *clickedButton{nullptr}; }; DlgCheckableMessageBox::DlgCheckableMessageBox(QWidget *parent) : diff --git a/src/Gui/DocumentModel.cpp b/src/Gui/DocumentModel.cpp index afbe60169b..57308e4a8b 100644 --- a/src/Gui/DocumentModel.cpp +++ b/src/Gui/DocumentModel.cpp @@ -103,8 +103,8 @@ namespace Gui { { qDeleteAll(childItems); childItems.clear(); } protected: - DocumentModelIndex() : parentItem(nullptr) {} - DocumentModelIndex *parentItem; + DocumentModelIndex() = default; + DocumentModelIndex *parentItem{nullptr}; QList childItems; }; diff --git a/src/Gui/DocumentObserver.cpp b/src/Gui/DocumentObserver.cpp index 90d8168f2c..8d698db764 100644 --- a/src/Gui/DocumentObserver.cpp +++ b/src/Gui/DocumentObserver.cpp @@ -284,7 +284,7 @@ Gui::Document* DocumentWeakPtrT::operator->() const noexcept class ViewProviderWeakPtrT::Private { public: - Private(ViewProviderDocumentObject* obj) : object(obj), indocument(false) { + Private(ViewProviderDocumentObject* obj) : object(obj) { set(obj); } void deletedDocument(const Gui::Document& doc) { @@ -338,7 +338,7 @@ public: } Gui::ViewProviderDocumentObject* object; - bool indocument; + bool indocument{false}; using Connection = boost::signals2::scoped_connection; Connection connectApplicationDeletedDocument; Connection connectDocumentCreatedObject; diff --git a/src/Gui/ExpressionBinding.cpp b/src/Gui/ExpressionBinding.cpp index 72472fada9..2906ccec03 100644 --- a/src/Gui/ExpressionBinding.cpp +++ b/src/Gui/ExpressionBinding.cpp @@ -47,11 +47,7 @@ using namespace Gui; using namespace App; namespace sp = std::placeholders; -ExpressionBinding::ExpressionBinding() - : m_autoApply(false) -{ -} - +ExpressionBinding::ExpressionBinding() = default; ExpressionBinding::~ExpressionBinding() = default; @@ -278,12 +274,7 @@ void ExpressionBinding::objectDeleted(const App::DocumentObject& obj) // ---------------------------------------------------------------------------- -ExpressionWidget::ExpressionWidget() - : iconLabel(nullptr) - , iconHeight(-1) -{ - -} +ExpressionWidget::ExpressionWidget() = default; QPixmap ExpressionWidget::getIcon(const char* name, const QSize& size) const { diff --git a/src/Gui/ExpressionBinding.h b/src/Gui/ExpressionBinding.h index 65d1bc9eec..7183195f26 100644 --- a/src/Gui/ExpressionBinding.h +++ b/src/Gui/ExpressionBinding.h @@ -78,7 +78,7 @@ protected: void objectDeleted(const App::DocumentObject&); boost::signals2::scoped_connection expressionchanged; boost::signals2::scoped_connection objectdeleted; - bool m_autoApply; + bool m_autoApply{false}; }; class GuiExport ExpressionWidget : public ExpressionBinding @@ -91,9 +91,9 @@ protected: void makeLabel(QLineEdit* parent); protected: - ExpressionLabel* iconLabel; + ExpressionLabel* iconLabel{nullptr}; QPalette defaultPalette; - int iconHeight; + int iconHeight{-1}; }; } diff --git a/src/Gui/GLBuffer.h b/src/Gui/GLBuffer.h index c0d1c0812d..7955cfd884 100644 --- a/src/Gui/GLBuffer.h +++ b/src/Gui/GLBuffer.h @@ -24,6 +24,7 @@ #ifndef GUI_GLBUFFER_H #define GUI_GLBUFFER_H +#include #include #include diff --git a/src/Gui/GLPainter.cpp b/src/Gui/GLPainter.cpp index 4844d64424..ed83191973 100644 --- a/src/Gui/GLPainter.cpp +++ b/src/Gui/GLPainter.cpp @@ -34,11 +34,6 @@ using namespace Gui; TYPESYSTEM_SOURCE_ABSTRACT(Gui::GLGraphicsItem, Base::BaseClass) GLPainter::GLPainter() - : viewer(nullptr) - , width(0) - , height(0) - , logicOp(false) - , lineStipple(false) { depthrange[0] = 0; depthrange[1] = 0; diff --git a/src/Gui/GLPainter.h b/src/Gui/GLPainter.h index 28a2294fb2..19e6bac343 100644 --- a/src/Gui/GLPainter.h +++ b/src/Gui/GLPainter.h @@ -75,12 +75,12 @@ public: //@} private: - QtGLWidget* viewer; + QtGLWidget* viewer{nullptr}; GLfloat depthrange[2]; GLdouble projectionmatrix[16]; - GLint width, height; - bool logicOp; - bool lineStipple; + GLint width{0}, height{0}; + bool logicOp{false}; + bool lineStipple{false}; }; class GuiExport GLGraphicsItem : public Base::BaseClass diff --git a/src/Gui/GestureNavigationStyle.cpp b/src/Gui/GestureNavigationStyle.cpp index d8a362f276..b15296213a 100644 --- a/src/Gui/GestureNavigationStyle.cpp +++ b/src/Gui/GestureNavigationStyle.cpp @@ -93,7 +93,7 @@ namespace Gui { class NS::Event : public sc::event { public: - Event():inventor_event(nullptr), modifiers{}, flags(new Flags){} + Event() : flags(new Flags){} virtual ~Event() = default; void log() const { @@ -197,8 +197,8 @@ public: }; public: - const SoEvent* inventor_event; - unsigned int modifiers; + const SoEvent* inventor_event{nullptr}; + unsigned int modifiers{0}; unsigned int mbstate() const {return modifiers & MASKBUTTONS;} unsigned int kbdstate() const {return modifiers & MASKMODIFIERS;} diff --git a/src/Gui/GraphvizView.cpp b/src/Gui/GraphvizView.cpp index 8bbfe8221a..2144365455 100644 --- a/src/Gui/GraphvizView.cpp +++ b/src/Gui/GraphvizView.cpp @@ -153,12 +153,11 @@ class GraphvizGraphicsView final : public QGraphicsView void mouseReleaseEvent(QMouseEvent *event) override; private: - bool isPanning; + bool isPanning{false}; QPoint panStart; }; -GraphvizGraphicsView::GraphvizGraphicsView(QGraphicsScene* scene, QWidget* parent) : QGraphicsView(scene, parent), - isPanning(false) +GraphvizGraphicsView::GraphvizGraphicsView(QGraphicsScene* scene, QWidget* parent) : QGraphicsView(scene, parent) { } diff --git a/src/Gui/GuiApplication.cpp b/src/Gui/GuiApplication.cpp index c297826795..a334766af4 100644 --- a/src/Gui/GuiApplication.cpp +++ b/src/Gui/GuiApplication.cpp @@ -167,8 +167,6 @@ public: explicit Private(GUISingleApplication *q_ptr) : q_ptr(q_ptr) , timer(new QTimer(q_ptr)) - , server(nullptr) - , running(false) { timer->setSingleShot(true); std::string exeName = App::Application::getExecutableName(); @@ -218,10 +216,10 @@ public: GUISingleApplication *q_ptr; QTimer *timer; - QLocalServer *server; + QLocalServer *server{nullptr}; QString serverName; QList messages; - bool running; + bool running{false}; }; GUISingleApplication::GUISingleApplication(int & argc, char ** argv) diff --git a/src/Gui/Macro.cpp b/src/Gui/Macro.cpp index 46f37674e8..83e8f38de0 100644 --- a/src/Gui/Macro.cpp +++ b/src/Gui/Macro.cpp @@ -43,11 +43,7 @@ using namespace Gui; -MacroFile::MacroFile() - : openMacro(false) -{ - -} +MacroFile::MacroFile() = default; void MacroFile::open(const char *sName) { @@ -136,10 +132,7 @@ void MacroFile::cancel() // ---------------------------------------------------------------------------- -MacroOutputBuffer::MacroOutputBuffer() - : totalLines(0) -{ -} +MacroOutputBuffer::MacroOutputBuffer() = default; void MacroOutputBuffer::addPendingLine(int type, const char* line) { @@ -170,12 +163,7 @@ void MacroOutputBuffer::incrementIfNoComment(int type) // ---------------------------------------------------------------------------- -MacroOutputOption::MacroOutputOption() - : recordGui(true) - , guiAsComment(true) - , scriptToPyConsole(true) -{ -} +MacroOutputOption::MacroOutputOption() = default; std::tuple MacroOutputOption::values(int type) const { @@ -213,9 +201,7 @@ bool MacroOutputOption::isAppCommand(int type) // ---------------------------------------------------------------------------- MacroManager::MacroManager() - : localEnv(true), - pyConsole(nullptr), - pyDebugger(new PythonDebugger()) + : pyDebugger(new PythonDebugger()) { // Attach to the Parametergroup regarding macros this->params = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Macro"); @@ -358,7 +344,7 @@ namespace Gui { class PythonRedirector { public: - PythonRedirector(const char* type, PyObject* obj) : std_out(type), out(obj), old(nullptr) + PythonRedirector(const char* type, PyObject* obj) : std_out(type), out(obj) { if (out) { Base::PyGILStateLocker lock; @@ -377,7 +363,7 @@ namespace Gui { private: const char* std_out; PyObject* out; - PyObject* old; + PyObject* old{nullptr}; }; } diff --git a/src/Gui/Macro.h b/src/Gui/Macro.h index 3b00702178..eeff49f568 100644 --- a/src/Gui/Macro.h +++ b/src/Gui/Macro.h @@ -56,7 +56,7 @@ public: private: QStringList macroInProgress; /**< Container for the macro */ QString macroName; /**< name of the macro */ - bool openMacro; + bool openMacro{false}; }; class MacroOutputBuffer @@ -75,7 +75,7 @@ public: } void incrementIfNoComment(int type); - long totalLines; + long totalLines{0}; std::vector > pendingLine; }; @@ -89,9 +89,9 @@ public: static bool isGuiCommand(int type); static bool isAppCommand(int type); - bool recordGui; - bool guiAsComment; - bool scriptToPyConsole; + bool recordGui{true}; + bool guiAsComment{true}; + bool scriptToPyConsole{true}; }; /** Macro recording and play back management @@ -170,8 +170,8 @@ private: MacroFile macroFile; MacroOutputBuffer buffer; MacroOutputOption option; - bool localEnv; - mutable PythonConsole* pyConsole; // link to the python console + bool localEnv{true}; + mutable PythonConsole* pyConsole{nullptr}; // link to the python console PythonDebugger* pyDebugger; Base::Reference params; // link to the Macro parameter group diff --git a/src/Gui/ManualAlignment.cpp b/src/Gui/ManualAlignment.cpp index fbac6c0621..5f82f4a58b 100644 --- a/src/Gui/ManualAlignment.cpp +++ b/src/Gui/ManualAlignment.cpp @@ -471,13 +471,12 @@ class ManualAlignment::Private { public: SoSeparator * picksepLeft; SoSeparator * picksepRight; - SoNodeSensor* sensorCam1; - SoNodeSensor* sensorCam2; + SoNodeSensor* sensorCam1{nullptr}; + SoNodeSensor* sensorCam2{nullptr}; SbRotation rot_cam1, rot_cam2; SbVec3f pos_cam1, pos_cam2; Private() - : sensorCam1(nullptr), sensorCam2(nullptr) { // left view picksepLeft = new SoSeparator; diff --git a/src/Gui/MergeDocuments.cpp b/src/Gui/MergeDocuments.cpp index 09502d673c..aeafb24704 100644 --- a/src/Gui/MergeDocuments.cpp +++ b/src/Gui/MergeDocuments.cpp @@ -74,7 +74,7 @@ private: }; } -MergeDocuments::MergeDocuments(App::Document* doc) : stream(nullptr), appdoc(doc) +MergeDocuments::MergeDocuments(App::Document* doc) : appdoc(doc) { //NOLINTBEGIN connectExport = doc->signalExportObjects.connect diff --git a/src/Gui/MergeDocuments.h b/src/Gui/MergeDocuments.h index 55eee8580b..d6945c0a79 100644 --- a/src/Gui/MergeDocuments.h +++ b/src/Gui/MergeDocuments.h @@ -27,6 +27,7 @@ #include #include #include +#include namespace zipios { class ZipInputStream; @@ -53,7 +54,7 @@ public: void RestoreDocFile(Base::Reader & r) override; private: - zipios::ZipInputStream* stream; + zipios::ZipInputStream* stream{nullptr}; App::Document* appdoc; Gui::Document* document; std::vector objects; diff --git a/src/Gui/MouseSelection.cpp b/src/Gui/MouseSelection.cpp index 3c1c639cba..b05278cb09 100644 --- a/src/Gui/MouseSelection.cpp +++ b/src/Gui/MouseSelection.cpp @@ -38,7 +38,7 @@ using namespace Gui; -AbstractMouseSelection::AbstractMouseSelection() : _pcView3D(nullptr) +AbstractMouseSelection::AbstractMouseSelection() { m_iXold = 0; m_iYold = 0; diff --git a/src/Gui/MouseSelection.h b/src/Gui/MouseSelection.h index 5191f22d2a..f798e25c41 100644 --- a/src/Gui/MouseSelection.h +++ b/src/Gui/MouseSelection.h @@ -95,7 +95,7 @@ protected: virtual void draw() {} protected: - Gui::View3DInventorViewer* _pcView3D; + Gui::View3DInventorViewer* _pcView3D{nullptr}; QCursor m_cPrevCursor; int m_iXold, m_iYold; int m_iXnew, m_iYnew; diff --git a/src/Gui/NavigationStyle.cpp b/src/Gui/NavigationStyle.cpp index f35265f303..e3490ead43 100644 --- a/src/Gui/NavigationStyle.cpp +++ b/src/Gui/NavigationStyle.cpp @@ -90,7 +90,7 @@ public: }; FCSphereSheetProjector(const SbSphere & sph, const SbBool orienttoeye = true) - : SbSphereSheetProjector(sph, orienttoeye), orbit(Trackball) + : SbSphereSheetProjector(sph, orienttoeye) { } @@ -169,7 +169,7 @@ public: private: SbMatrix worldToScreen; - OrbitStyle orbit; + OrbitStyle orbit{Trackball}; }; NavigationStyleEvent::NavigationStyleEvent(const Base::Type& s) diff --git a/src/Gui/NavigationStyle.h b/src/Gui/NavigationStyle.h index 8d9b2dfb1a..cbc6204a9a 100644 --- a/src/Gui/NavigationStyle.h +++ b/src/Gui/NavigationStyle.h @@ -232,7 +232,7 @@ protected: SbTime * time; } log; - View3DInventorViewer* viewer; + View3DInventorViewer* viewer{nullptr}; ViewerMode currentmode; SoMouseButtonEvent mouseDownConsumedEvent; SbVec2f lastmouseposition; @@ -251,7 +251,7 @@ protected: /** @name Mouse model */ //@{ - AbstractMouseSelection* mouseSelection; + AbstractMouseSelection* mouseSelection{nullptr}; std::vector pcPolygon; SelectionRole selectedRole; //@} @@ -319,7 +319,7 @@ protected: SbBool processSoEvent(const SoEvent * const ev) override; private: - SbBool lockButton1; + SbBool lockButton1{false}; }; class GuiExport RevitNavigationStyle : public UserNavigationStyle { @@ -336,7 +336,7 @@ protected: SbBool processSoEvent(const SoEvent * const ev) override; private: - SbBool lockButton1; + SbBool lockButton1{false}; }; class GuiExport BlenderNavigationStyle : public UserNavigationStyle { @@ -353,7 +353,7 @@ protected: SbBool processSoEvent(const SoEvent * const ev) override; private: - SbBool lockButton1; + SbBool lockButton1{false}; }; class GuiExport MayaGestureNavigationStyle : public UserNavigationStyle { diff --git a/src/Gui/PythonDebugger.cpp b/src/Gui/PythonDebugger.cpp index 3b0aeab925..0d398c4d17 100644 --- a/src/Gui/PythonDebugger.cpp +++ b/src/Gui/PythonDebugger.cpp @@ -321,24 +321,20 @@ private: }; struct PythonDebuggerP { - PyObject* out_o; - PyObject* err_o; - PyObject* exc_o; - PyObject* out_n; - PyObject* err_n; - PyObject* exc_n; + PyObject* out_o{nullptr}; + PyObject* err_o{nullptr}; + PyObject* exc_o{nullptr}; + PyObject* out_n{nullptr}; + PyObject* err_n{nullptr}; + PyObject* exc_n{nullptr}; PythonDebugExcept* pypde; - bool init, trystop, running; + bool init{false}, trystop{false}, running{false}; QEventLoop loop; - PyObject* pydbg; + PyObject* pydbg{nullptr}; std::vector bps; - explicit PythonDebuggerP(PythonDebugger* that) : - init(false), trystop(false), running(false) + explicit PythonDebuggerP(PythonDebugger* that) { - out_o = nullptr; - err_o = nullptr; - exc_o = nullptr; Base::PyGILStateLocker lock; out_n = new PythonDebugStdout(); err_n = new PythonDebugStderr(); diff --git a/src/Gui/PythonEditor.cpp b/src/Gui/PythonEditor.cpp index de015145aa..ffea4c72ba 100644 --- a/src/Gui/PythonEditor.cpp +++ b/src/Gui/PythonEditor.cpp @@ -43,15 +43,14 @@ using namespace Gui; namespace Gui { struct PythonEditorP { - int debugLine; + int debugLine{-1}; QRect debugRect; QPixmap breakpoint; QPixmap debugMarker; QString filename; PythonDebugger* debugger; PythonEditorP() - : debugLine(-1), - breakpoint(BitmapFactory().iconFromTheme("breakpoint").pixmap(16,16)), + : breakpoint(BitmapFactory().iconFromTheme("breakpoint").pixmap(16,16)), debugMarker(BitmapFactory().iconFromTheme("debug-marker").pixmap(16,16)) { debugger = Application::Instance->macroManager()->debugger(); diff --git a/src/Gui/Selection.cpp b/src/Gui/Selection.cpp index 206588d213..d74f499f9c 100644 --- a/src/Gui/Selection.cpp +++ b/src/Gui/Selection.cpp @@ -1608,7 +1608,6 @@ void SelectionSingleton::slotDeletedObject(const App::DocumentObject& Obj) */ SelectionSingleton::SelectionSingleton() :CurrentPreselection(SelectionChanges::ClrSelection) - ,_needPickedList(false) { hx = 0; hy = 0; diff --git a/src/Gui/Selection.h b/src/Gui/Selection.h index 56e3e9c503..32d4dac94b 100644 --- a/src/Gui/Selection.h +++ b/src/Gui/Selection.h @@ -671,7 +671,7 @@ protected: mutable std::list<_SelObj> _SelList; mutable std::list<_SelObj> _PickedList; - bool _needPickedList; + bool _needPickedList{false}; using SelStackItem = std::set; std::deque _SelStackBack; diff --git a/src/Gui/SoFCCSysDragger.cpp b/src/Gui/SoFCCSysDragger.cpp index 05874a701c..038d09f22f 100644 --- a/src/Gui/SoFCCSysDragger.cpp +++ b/src/Gui/SoFCCSysDragger.cpp @@ -661,8 +661,7 @@ void SoFCCSysDragger::initClass() } SoFCCSysDragger::SoFCCSysDragger() - :axisScale(1.0f,1.0f,1.0f) - ,scaleInited(false) + : axisScale(1.0f,1.0f,1.0f) { SO_KIT_CONSTRUCTOR(SoFCCSysDragger); diff --git a/src/Gui/SoFCCSysDragger.h b/src/Gui/SoFCCSysDragger.h index 91aa418d68..66272cc916 100644 --- a/src/Gui/SoFCCSysDragger.h +++ b/src/Gui/SoFCCSysDragger.h @@ -264,7 +264,7 @@ private: // auto scale. SbVec3f axisScale; - bool scaleInited; + bool scaleInited{false}; void updateAxisScale(); diff --git a/src/Gui/SoFCColorBar.cpp b/src/Gui/SoFCColorBar.cpp index 638e6f9b61..64a12ae90a 100644 --- a/src/Gui/SoFCColorBar.cpp +++ b/src/Gui/SoFCColorBar.cpp @@ -46,7 +46,7 @@ SO_NODE_ABSTRACT_SOURCE(SoFCColorBarBase) /*! Constructor. */ -SoFCColorBarBase::SoFCColorBarBase() : _boxWidth(-1.0f), _windowSize(0,0) +SoFCColorBarBase::SoFCColorBarBase() : _windowSize(0,0) { SO_NODE_CONSTRUCTOR(SoFCColorBarBase); } diff --git a/src/Gui/SoFCColorBar.h b/src/Gui/SoFCColorBar.h index 6f597c7ec1..5ad7acadfc 100644 --- a/src/Gui/SoFCColorBar.h +++ b/src/Gui/SoFCColorBar.h @@ -138,7 +138,7 @@ protected: ~SoFCColorBarBase () override; private: - float _boxWidth; + float _boxWidth{-1.0F}; SbVec2s _windowSize; }; diff --git a/src/Gui/SoFCColorGradient.cpp b/src/Gui/SoFCColorGradient.cpp index e32553acbe..ae36f585b4 100644 --- a/src/Gui/SoFCColorGradient.cpp +++ b/src/Gui/SoFCColorGradient.cpp @@ -50,7 +50,7 @@ SO_NODE_SOURCE(SoFCColorGradient) /*! Constructor. */ -SoFCColorGradient::SoFCColorGradient() : _bbox(5.0f, -4.0f, 5.5f, 4.0f), _precision(3) +SoFCColorGradient::SoFCColorGradient() : _bbox(5.0f, -4.0f, 5.5f, 4.0f) { SO_NODE_CONSTRUCTOR(SoFCColorGradient); coords = new SoCoordinate3; diff --git a/src/Gui/SoFCColorGradient.h b/src/Gui/SoFCColorGradient.h index 7fd6b42815..478668a326 100644 --- a/src/Gui/SoFCColorGradient.h +++ b/src/Gui/SoFCColorGradient.h @@ -103,7 +103,7 @@ private: SoCoordinate3* coords; SoSeparator* labels; SbBox2f _bbox; - int _precision; + int _precision{3}; App::ColorGradient _cColGrad; }; diff --git a/src/Gui/SoFCInteractiveElement.cpp b/src/Gui/SoFCInteractiveElement.cpp index fc9deb97af..497ddd62dc 100644 --- a/src/Gui/SoFCInteractiveElement.cpp +++ b/src/Gui/SoFCInteractiveElement.cpp @@ -180,7 +180,7 @@ SO_NODE_SOURCE(SoGLWidgetNode) /*! Constructor. */ -SoGLWidgetNode::SoGLWidgetNode() : window(nullptr) +SoGLWidgetNode::SoGLWidgetNode() { SO_NODE_CONSTRUCTOR(SoGLWidgetNode); } diff --git a/src/Gui/SoFCInteractiveElement.h b/src/Gui/SoFCInteractiveElement.h index d8ad66def7..41eb54ca37 100644 --- a/src/Gui/SoFCInteractiveElement.h +++ b/src/Gui/SoFCInteractiveElement.h @@ -117,7 +117,7 @@ public: static void initClass(); SoGLWidgetNode(); - QtGLWidget * window; + QtGLWidget * window{nullptr}; void doAction(SoAction * action) override; void GLRender(SoGLRenderAction * action) override; diff --git a/src/Gui/SoFCSelectionAction.cpp b/src/Gui/SoFCSelectionAction.cpp index 141a2cbfc0..14777bd78b 100644 --- a/src/Gui/SoFCSelectionAction.cpp +++ b/src/Gui/SoFCSelectionAction.cpp @@ -692,7 +692,7 @@ void SoFCDocumentObjectAction::finish() atexit_cleanup(); } -SoFCDocumentObjectAction::SoFCDocumentObjectAction () : _handled(false) +SoFCDocumentObjectAction::SoFCDocumentObjectAction() { SO_ACTION_CONSTRUCTOR(SoFCDocumentObjectAction); } @@ -760,7 +760,7 @@ void SoGLSelectAction::initClass() SoGLSelectAction::SoGLSelectAction (const SbViewportRegion& region, const SbViewportRegion& select) - : vpregion(region), vpselect(select), _handled(false) + : vpregion(region), vpselect(select) { SO_ACTION_CONSTRUCTOR(SoGLSelectAction); } @@ -833,7 +833,7 @@ void SoVisibleFaceAction::initClass() SO_ACTION_ADD_METHOD(SoFCSelection,callDoAction); } -SoVisibleFaceAction::SoVisibleFaceAction () : _handled(false) +SoVisibleFaceAction::SoVisibleFaceAction () { SO_ACTION_CONSTRUCTOR(SoVisibleFaceAction); } @@ -930,33 +930,21 @@ class SoBoxSelectionRenderActionP { public: SoBoxSelectionRenderActionP(SoBoxSelectionRenderAction * master) : master(master) - , searchaction(nullptr) - , selectsearch(nullptr) - , camerasearch(nullptr) - , bboxaction(nullptr) - , basecolor(nullptr) - , postprocpath(nullptr) - , highlightPath(nullptr) - , localRoot(nullptr) - , xform(nullptr) - , cube(nullptr) - , drawstyle(nullptr) { - } SoBoxSelectionRenderAction * master; - SoSearchAction * searchaction; - SoSearchAction * selectsearch; - SoSearchAction * camerasearch; - SoGetBoundingBoxAction * bboxaction; - SoBaseColor * basecolor; - SoTempPath * postprocpath; - SoPath * highlightPath; - SoSeparator * localRoot; - SoMatrixTransform * xform; - SoCube * cube; - SoDrawStyle * drawstyle; + SoSearchAction * searchaction{nullptr}; + SoSearchAction * selectsearch{nullptr}; + SoSearchAction * camerasearch{nullptr}; + SoGetBoundingBoxAction * bboxaction{nullptr}; + SoBaseColor * basecolor{nullptr}; + SoTempPath * postprocpath{nullptr}; + SoPath * highlightPath{nullptr}; + SoSeparator * localRoot{nullptr}; + SoMatrixTransform * xform{nullptr}; + SoCube * cube{nullptr}; + SoDrawStyle * drawstyle{nullptr}; SoColorPacker colorpacker; void initBoxGraph(); diff --git a/src/Gui/SoFCSelectionAction.h b/src/Gui/SoFCSelectionAction.h index 4661d3fd54..7576ca911a 100644 --- a/src/Gui/SoFCSelectionAction.h +++ b/src/Gui/SoFCSelectionAction.h @@ -243,7 +243,7 @@ public: SbString componentName; private: - SbBool _handled; + SbBool _handled{false}; }; /** @@ -276,7 +276,7 @@ public: private: const SbViewportRegion& vpregion; const SbViewportRegion& vpselect; - SbBool _handled; + SbBool _handled{false}; }; /** @@ -302,7 +302,7 @@ private: static void callDoAction(SoAction *action,SoNode *node); private: - SbBool _handled; + SbBool _handled{false}; }; class SoBoxSelectionRenderActionP; diff --git a/src/Gui/SoFCSelectionContext.cpp b/src/Gui/SoFCSelectionContext.cpp index 2e5e27c6f8..ee5a73849e 100644 --- a/src/Gui/SoFCSelectionContext.cpp +++ b/src/Gui/SoFCSelectionContext.cpp @@ -237,12 +237,9 @@ int SoFCSelectionContextEx::merge(int status, SoFCSelectionContextBasePtr &outpu /////////////////////////////////////////////////////////////////////// SoFCSelectionCounter::SoFCSelectionCounter() - :counter(std::make_shared(0)) - ,hasSelection(false) - ,hasPreselection(false) + : counter(std::make_shared(0)) {} - SoFCSelectionCounter::~SoFCSelectionCounter() = default; diff --git a/src/Gui/SoFCSelectionContext.h b/src/Gui/SoFCSelectionContext.h index 5c22d8bc3b..390e57a018 100644 --- a/src/Gui/SoFCSelectionContext.h +++ b/src/Gui/SoFCSelectionContext.h @@ -32,6 +32,7 @@ #include +class SoState; namespace Gui { @@ -131,8 +132,8 @@ public: void checkAction(SoSelectionElementAction *selaction, SoFCSelectionContextPtr ctx); protected: std::shared_ptr counter; - bool hasSelection; - bool hasPreselection; + bool hasSelection{false}; + bool hasPreselection{false}; static int cachingMode; }; diff --git a/src/Gui/SoFCUnifiedSelection.cpp b/src/Gui/SoFCUnifiedSelection.cpp index fb7261e462..b33811c7e6 100644 --- a/src/Gui/SoFCUnifiedSelection.cpp +++ b/src/Gui/SoFCUnifiedSelection.cpp @@ -102,7 +102,7 @@ SO_NODE_SOURCE(SoFCUnifiedSelection) /*! Constructor. */ -SoFCUnifiedSelection::SoFCUnifiedSelection() : pcDocument(nullptr) +SoFCUnifiedSelection::SoFCUnifiedSelection() { SO_NODE_CONSTRUCTOR(SoFCUnifiedSelection); @@ -794,7 +794,7 @@ void SoHighlightElementAction::initClass() SO_ACTION_ADD_METHOD(SoPointSet,callDoAction); } -SoHighlightElementAction::SoHighlightElementAction () : _highlight(false), _det(nullptr) +SoHighlightElementAction::SoHighlightElementAction () { SO_ACTION_CONSTRUCTOR(SoHighlightElementAction); } @@ -863,7 +863,7 @@ void SoSelectionElementAction::initClass() } SoSelectionElementAction::SoSelectionElementAction (Type t, bool secondary) - : _type(t), _det(nullptr), _secondary(secondary) + : _type(t), _secondary(secondary) { SO_ACTION_CONSTRUCTOR(SoSelectionElementAction); } @@ -933,7 +933,7 @@ void SoVRMLAction::initClass() SO_ACTION_ADD_METHOD(SoPointSet,callDoAction); } -SoVRMLAction::SoVRMLAction() : overrideMode(true) +SoVRMLAction::SoVRMLAction() { SO_ACTION_CONSTRUCTOR(SoVRMLAction); } diff --git a/src/Gui/SoFCUnifiedSelection.h b/src/Gui/SoFCUnifiedSelection.h index 06c4daadc0..8fe068d2bc 100644 --- a/src/Gui/SoFCUnifiedSelection.h +++ b/src/Gui/SoFCUnifiedSelection.h @@ -104,11 +104,9 @@ private: static int getPriority(const SoPickedPoint* p); struct PickedInfo { - const SoPickedPoint *pp; - ViewProviderDocumentObject *vpd; + const SoPickedPoint *pp{nullptr}; + ViewProviderDocumentObject *vpd{nullptr}; std::string element; - PickedInfo():pp(nullptr),vpd(nullptr) - {} }; bool setHighlight(const PickedInfo &); @@ -118,7 +116,7 @@ private: std::vector getPickedList(SoHandleEventAction* action, bool singlePick) const; - Gui::Document *pcDocument; + Gui::Document *pcDocument{nullptr}; static SoFullPath * currenthighlight; SoFullPath * detailPath; @@ -403,9 +401,9 @@ private: static void callDoAction(SoAction *action,SoNode *node); private: - SbBool _highlight; + SbBool _highlight{false}; SbColor _color; - const SoDetail* _det; + const SoDetail* _det{nullptr}; }; /** @@ -457,7 +455,7 @@ private: private: Type _type; SbColor _color; - const SoDetail* _det; + const SoDetail* _det{nullptr}; std::map _colors; bool _secondary; }; @@ -478,7 +476,7 @@ public: static void initClass(); private: - SbBool overrideMode; + SbBool overrideMode{true}; std::list bindList; static void callDoAction(SoAction *action,SoNode *node); diff --git a/src/Gui/SoFCVectorizeSVGAction.cpp b/src/Gui/SoFCVectorizeSVGAction.cpp index 9054177e73..449d858c32 100644 --- a/src/Gui/SoFCVectorizeSVGAction.cpp +++ b/src/Gui/SoFCVectorizeSVGAction.cpp @@ -376,10 +376,7 @@ void SoFCVectorizeSVGAction::initClass() SO_ACTION_INIT_CLASS(SoFCVectorizeSVGAction, SoVectorizeAction); } -SoFCVectorizeSVGAction::SoFCVectorizeSVGAction() : - m_backgroundState(true), - m_lineWidth(1.0), - m_usemm(false) +SoFCVectorizeSVGAction::SoFCVectorizeSVGAction() { SO_ACTION_CONSTRUCTOR(SoFCVectorizeSVGAction); this->setOutput(new SoSVGVectorOutput); diff --git a/src/Gui/SoFCVectorizeSVGAction.h b/src/Gui/SoFCVectorizeSVGAction.h index 6325b4e1c0..fdc3e6873d 100644 --- a/src/Gui/SoFCVectorizeSVGAction.h +++ b/src/Gui/SoFCVectorizeSVGAction.h @@ -78,9 +78,9 @@ protected: private: SoFCVectorizeSVGActionP* p; friend class SoFCVectorizeSVGActionP; - bool m_backgroundState; - double m_lineWidth; - bool m_usemm; + bool m_backgroundState{true}; + double m_lineWidth{1.0}; + bool m_usemm{false}; }; } // namespace Gui diff --git a/src/Gui/SoTouchEvents.h b/src/Gui/SoTouchEvents.h index c7d16c5e94..3df1dc96ea 100644 --- a/src/Gui/SoTouchEvents.h +++ b/src/Gui/SoTouchEvents.h @@ -39,7 +39,7 @@ public: static void initClass(){ SO_EVENT_INIT_CLASS(SoGestureEvent, SoEvent); } - SoGestureEvent() : state(SbGSNoGesture) {} + SoGestureEvent() = default; ~SoGestureEvent() override = default; SbBool isSoGestureEvent(const SoEvent* ev) const; @@ -50,7 +50,7 @@ public: SbGSEnd = Qt::GestureFinished, SbGsCanceled = Qt::GestureCanceled }; - SbGestureState state; + SbGestureState state{SbGSNoGesture}; }; class SoGesturePanEvent : public SoGestureEvent { diff --git a/src/Gui/SpaceballEvent.cpp b/src/Gui/SpaceballEvent.cpp index 7c4b004376..f383121761 100644 --- a/src/Gui/SpaceballEvent.cpp +++ b/src/Gui/SpaceballEvent.cpp @@ -31,16 +31,15 @@ int MotionEvent::MotionEventType = -1; int ButtonEvent::ButtonEventType = -1; #if QT_VERSION < QT_VERSION_CHECK(6,0,0) -EventBase::EventBase(QEvent::Type event) : QInputEvent(static_cast(event)), handled(false) +EventBase::EventBase(QEvent::Type event) : QInputEvent(static_cast(event)) #else -EventBase::EventBase(QEvent::Type event) : QInputEvent(static_cast(event), QPointingDevice::primaryPointingDevice()), handled(false) +EventBase::EventBase(QEvent::Type event) : QInputEvent(static_cast(event), QPointingDevice::primaryPointingDevice()) #endif { } -MotionEvent::MotionEvent() : EventBase(static_cast(MotionEventType)), - xTrans(0), yTrans(0), zTrans(0), xRot(0), yRot(0), zRot(0) +MotionEvent::MotionEvent() : EventBase(static_cast(MotionEventType)) { } diff --git a/src/Gui/SpaceballEvent.h b/src/Gui/SpaceballEvent.h index ea56fc6d23..32f16a1bc3 100644 --- a/src/Gui/SpaceballEvent.h +++ b/src/Gui/SpaceballEvent.h @@ -37,7 +37,7 @@ namespace Spaceball protected: explicit EventBase(QEvent::Type event); - bool handled; + bool handled{false}; }; class MotionEvent : public EventBase @@ -61,12 +61,12 @@ namespace Spaceball static int MotionEventType; private: - int xTrans; - int yTrans; - int zTrans; - int xRot; - int yRot; - int zRot; + int xTrans{0}; + int yTrans{0}; + int zTrans{0}; + int xRot{0}; + int yRot{0}; + int zRot{0}; }; class ButtonEvent : public EventBase diff --git a/src/Gui/SpinBox.cpp b/src/Gui/SpinBox.cpp index abd3c7076a..85113b3df2 100644 --- a/src/Gui/SpinBox.cpp +++ b/src/Gui/SpinBox.cpp @@ -278,11 +278,9 @@ namespace Gui { class UIntSpinBoxPrivate { public: - UnsignedValidator * mValidator; + UnsignedValidator * mValidator{nullptr}; - UIntSpinBoxPrivate() : mValidator(nullptr) - { - } + UIntSpinBoxPrivate() = default; uint mapToUInt( int v ) const { uint ui; diff --git a/src/Gui/Thumbnail.cpp b/src/Gui/Thumbnail.cpp index 016c6e57e3..ac0962e155 100644 --- a/src/Gui/Thumbnail.cpp +++ b/src/Gui/Thumbnail.cpp @@ -42,7 +42,7 @@ using namespace Gui; -Thumbnail::Thumbnail(int s) : viewer(nullptr), size(s) +Thumbnail::Thumbnail(int s) : size(s) { } diff --git a/src/Gui/Thumbnail.h b/src/Gui/Thumbnail.h index 2563ef30df..54176b13a1 100644 --- a/src/Gui/Thumbnail.h +++ b/src/Gui/Thumbnail.h @@ -57,7 +57,7 @@ public: private: QUrl uri; - View3DInventorViewer* viewer; + View3DInventorViewer* viewer{nullptr}; int size; }; diff --git a/src/Gui/ToolBoxManager.cpp b/src/Gui/ToolBoxManager.cpp index 1c7087eb5a..f1912c9493 100644 --- a/src/Gui/ToolBoxManager.cpp +++ b/src/Gui/ToolBoxManager.cpp @@ -53,9 +53,7 @@ void ToolBoxManager::destruct() _instance = nullptr; } -ToolBoxManager::ToolBoxManager() : _toolBox(nullptr) -{ -} +ToolBoxManager::ToolBoxManager() = default; ToolBoxManager::~ToolBoxManager() = default; diff --git a/src/Gui/ToolBoxManager.h b/src/Gui/ToolBoxManager.h index 4bb8025bd8..2c527f2ce4 100644 --- a/src/Gui/ToolBoxManager.h +++ b/src/Gui/ToolBoxManager.h @@ -24,6 +24,8 @@ #ifndef GUI_TOOLBOXMANAGER_H #define GUI_TOOLBOXMANAGER_H +#include + namespace Gui { class ToolBarItem; @@ -55,7 +57,7 @@ protected: ~ToolBoxManager(); private: - DockWnd::ToolBox* _toolBox; + DockWnd::ToolBox* _toolBox{nullptr}; static ToolBoxManager* _instance; }; diff --git a/src/Gui/Tree.cpp b/src/Gui/Tree.cpp index 0a63be3bf3..2dfab108ad 100644 --- a/src/Gui/Tree.cpp +++ b/src/Gui/Tree.cpp @@ -199,7 +199,7 @@ public: DocumentItem* docItem; DocumentObjectItems items; ViewProviderDocumentObject* viewObject; - DocumentObjectItem* rootItem; + DocumentObjectItem* rootItem{nullptr}; std::vector children; std::set childSet; bool removeChildrenFromRoot; @@ -214,7 +214,8 @@ public: Connection connectStat; DocumentObjectData(DocumentItem* docItem, ViewProviderDocumentObject* vpd) - : docItem(docItem), viewObject(vpd), rootItem(nullptr) + : docItem(docItem) + , viewObject(vpd) { //NOLINTBEGIN // Setup connections @@ -2433,13 +2434,13 @@ void TreeWidget::slotActiveDocument(const Gui::Document& Doc) struct UpdateDisabler { QWidget& widget; int& blocked; - bool visible; - bool focus; + bool visible{false}; + bool focus{false}; // Note! DO NOT block signal here, or else // QTreeWidgetItem::setChildIndicatorPolicy() does not work UpdateDisabler(QWidget& w, int& blocked) - : widget(w), blocked(blocked), visible(false), focus(false) + : widget(w), blocked(blocked) { if (++blocked > 1) return; diff --git a/src/Gui/View.cpp b/src/Gui/View.cpp index 486f7e3f4f..bbd0010ac5 100644 --- a/src/Gui/View.cpp +++ b/src/Gui/View.cpp @@ -37,7 +37,7 @@ TYPESYSTEM_SOURCE_ABSTRACT(Gui::BaseView,Base::BaseClass) BaseView::BaseView( Gui::Document* pcDocument) - :_pcDocument(pcDocument), bIsDetached(false) + :_pcDocument(pcDocument) { if (pcDocument){ pcDocument->attachView(this); diff --git a/src/Gui/View.h b/src/Gui/View.h index fd588e6145..c09bcdfd0d 100644 --- a/src/Gui/View.h +++ b/src/Gui/View.h @@ -105,8 +105,8 @@ public: protected: Gui::Document* _pcDocument; - bool bIsDetached; - bool bIsPassive; + bool bIsDetached{false}; + bool bIsPassive{false}; }; } // namespace Gui diff --git a/src/Gui/ViewProvider.cpp b/src/Gui/ViewProvider.cpp index 5d9dacb527..63f813d75a 100644 --- a/src/Gui/ViewProvider.cpp +++ b/src/Gui/ViewProvider.cpp @@ -88,12 +88,7 @@ void coinRemoveAllChildren(SoGroup *group) { PROPERTY_SOURCE_ABSTRACT(Gui::ViewProvider, App::TransactionalObject) ViewProvider::ViewProvider() - : pcAnnotation(nullptr) - , pyViewObject(nullptr) - , overrideMode("As Is") - , _iActualMode(-1) - , _iEditMode(-1) - , viewOverrideMode(-1) + : overrideMode("As Is") { setStatus(UpdateData, true); diff --git a/src/Gui/ViewProvider.h b/src/Gui/ViewProvider.h index 6e882e7e19..a319ec0c8d 100644 --- a/src/Gui/ViewProvider.h +++ b/src/Gui/ViewProvider.h @@ -564,15 +564,15 @@ protected: /// this is the mode switch, all the different viewing modes are collected here SoSwitch *pcModeSwitch; /// The root separator for annotations - SoSeparator *pcAnnotation; - ViewProviderPy* pyViewObject; + SoSeparator *pcAnnotation{nullptr}; + ViewProviderPy* pyViewObject{nullptr}; std::string overrideMode; std::bitset<32> StatusBits; private: - int _iActualMode; - int _iEditMode; - int viewOverrideMode; + int _iActualMode{-1}; + int _iEditMode{-1}; + int viewOverrideMode{-1}; std::string _sCurrentMode; std::map _sDisplayMaskModes; }; diff --git a/src/Gui/ViewProviderDocumentObject.cpp b/src/Gui/ViewProviderDocumentObject.cpp index 8286f6a214..31dd847fba 100644 --- a/src/Gui/ViewProviderDocumentObject.cpp +++ b/src/Gui/ViewProviderDocumentObject.cpp @@ -58,8 +58,6 @@ using namespace Gui; PROPERTY_SOURCE(Gui::ViewProviderDocumentObject, Gui::ViewProvider) ViewProviderDocumentObject::ViewProviderDocumentObject() - : pcObject(nullptr) - , pcDocument(nullptr) { static const char *dogroup = "Display Options"; static const char *sgroup = "Selection"; diff --git a/src/Gui/ViewProviderDocumentObject.h b/src/Gui/ViewProviderDocumentObject.h index f01c808069..14b8cd38c6 100644 --- a/src/Gui/ViewProviderDocumentObject.h +++ b/src/Gui/ViewProviderDocumentObject.h @@ -210,8 +210,8 @@ protected: void addDefaultAction(QMenu*, const QString&); protected: - App::DocumentObject *pcObject; - Gui::Document* pcDocument; + App::DocumentObject *pcObject{nullptr}; + Gui::Document* pcDocument{nullptr}; private: bool _Showable = true; diff --git a/src/Gui/ViewProviderGeometryObject.cpp b/src/Gui/ViewProviderGeometryObject.cpp index 7ffaf7bb4a..03102539b1 100644 --- a/src/Gui/ViewProviderGeometryObject.cpp +++ b/src/Gui/ViewProviderGeometryObject.cpp @@ -56,8 +56,6 @@ PROPERTY_SOURCE(Gui::ViewProviderGeometryObject, Gui::ViewProviderDragger) const App::PropertyIntegerConstraint::Constraints intPercent = {0, 100, 5}; ViewProviderGeometryObject::ViewProviderGeometryObject() - : pcBoundSwitch(nullptr) - , pcBoundColor(nullptr) { ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View"); bool randomColor = hGrp->GetBool("RandomColor", false); diff --git a/src/Gui/ViewProviderGeometryObject.h b/src/Gui/ViewProviderGeometryObject.h index 0b16849284..34fb86f0f0 100644 --- a/src/Gui/ViewProviderGeometryObject.h +++ b/src/Gui/ViewProviderGeometryObject.h @@ -95,10 +95,10 @@ protected: virtual unsigned long getBoundColor() const; protected: - SoMaterial * pcShapeMaterial; - SoFCBoundingBox * pcBoundingBox; - SoSwitch * pcBoundSwitch; - SoBaseColor * pcBoundColor; + SoMaterial * pcShapeMaterial{nullptr}; + SoFCBoundingBox * pcBoundingBox{nullptr}; + SoSwitch * pcBoundSwitch{nullptr}; + SoBaseColor * pcBoundColor{nullptr}; }; } // namespace Gui diff --git a/src/Gui/ViewProviderGroupExtension.cpp b/src/Gui/ViewProviderGroupExtension.cpp index 55178bf0f1..45ce98d452 100644 --- a/src/Gui/ViewProviderGroupExtension.cpp +++ b/src/Gui/ViewProviderGroupExtension.cpp @@ -43,7 +43,7 @@ using namespace Gui; EXTENSION_PROPERTY_SOURCE(Gui::ViewProviderGroupExtension, Gui::ViewProviderExtension) -ViewProviderGroupExtension::ViewProviderGroupExtension() : guard(false) +ViewProviderGroupExtension::ViewProviderGroupExtension() { initExtensionType(ViewProviderGroupExtension::getExtensionClassTypeId()); } diff --git a/src/Gui/ViewProviderGroupExtension.h b/src/Gui/ViewProviderGroupExtension.h index 11bbd531e6..882d96c0f4 100644 --- a/src/Gui/ViewProviderGroupExtension.h +++ b/src/Gui/ViewProviderGroupExtension.h @@ -52,7 +52,7 @@ public: bool extensionOnDelete(const std::vector &) override; private: - bool guard; + bool guard{false}; std::vector nodes; }; diff --git a/src/Gui/ViewProviderPythonFeature.cpp b/src/Gui/ViewProviderPythonFeature.cpp index 31f07284d6..4f7670d7db 100644 --- a/src/Gui/ViewProviderPythonFeature.cpp +++ b/src/Gui/ViewProviderPythonFeature.cpp @@ -57,7 +57,8 @@ namespace sp = std::placeholders; ViewProviderPythonFeatureImp::ViewProviderPythonFeatureImp( ViewProviderDocumentObject* vp, App::PropertyPythonObject &proxy) - : object(vp), Proxy(proxy), has__object__(false) + : object(vp) + , Proxy(proxy) { } diff --git a/src/Gui/ViewProviderPythonFeature.h b/src/Gui/ViewProviderPythonFeature.h index 7c6911386a..d074f5198b 100644 --- a/src/Gui/ViewProviderPythonFeature.h +++ b/src/Gui/ViewProviderPythonFeature.h @@ -129,7 +129,7 @@ public: private: ViewProviderDocumentObject* object; App::PropertyPythonObject &Proxy; - bool has__object__; + bool has__object__{false}; #define FC_PY_VIEW_OBJECT \ FC_PY_ELEMENT(getIcon) \ @@ -199,7 +199,7 @@ class ViewProviderPythonFeatureT : public ViewProviderT public: /// constructor. - ViewProviderPythonFeatureT() : _attached(false) { + ViewProviderPythonFeatureT() { ADD_PROPERTY(Proxy,(Py::Object())); imp = new ViewProviderPythonFeatureImp(this,Proxy); } @@ -619,7 +619,7 @@ private: App::PropertyPythonObject Proxy; mutable std::string defaultMode; std::string viewerMode; - bool _attached; + bool _attached{false}; }; // Special Feature-Python classes diff --git a/src/Gui/WaitCursor.cpp b/src/Gui/WaitCursor.cpp index 4d0f4a4d08..3d548b43b8 100644 --- a/src/Gui/WaitCursor.cpp +++ b/src/Gui/WaitCursor.cpp @@ -53,14 +53,14 @@ protected: private: WaitCursorP(); // Disable constructor static WaitCursorP* _instance; - bool isOn; - WaitCursor::FilterEventsFlags flags; + bool isOn{false}; + WaitCursor::FilterEventsFlags flags{WaitCursor::AllEvents}; }; } // namespace Gui WaitCursorP* WaitCursorP::_instance = nullptr; -WaitCursorP::WaitCursorP() : QObject(nullptr), isOn(false), flags(WaitCursor::AllEvents) +WaitCursorP::WaitCursorP() : QObject(nullptr) { } diff --git a/src/Gui/Widgets.cpp b/src/Gui/Widgets.cpp index b5caafe9e9..6bb50af393 100644 --- a/src/Gui/Widgets.cpp +++ b/src/Gui/Widgets.cpp @@ -618,23 +618,12 @@ struct ColorButtonP { QColor old, col; QPointer cd; - bool allowChange; - bool autoChange; - bool drawFrame; - bool allowTransparency; - bool modal; - bool dirty; - - ColorButtonP() - : cd(nullptr) - , allowChange(true) - , autoChange(false) - , drawFrame(true) - , allowTransparency(false) - , modal(true) - , dirty(true) - { - } + bool allowChange{true}; + bool autoChange{false}; + bool drawFrame{true}; + bool allowTransparency{false}; + bool modal{true}; + bool dirty{true}; }; } diff --git a/src/Gui/Workbench.cpp b/src/Gui/Workbench.cpp index 67331700b7..c1d65aa3aa 100644 --- a/src/Gui/Workbench.cpp +++ b/src/Gui/Workbench.cpp @@ -1021,10 +1021,7 @@ ToolBarItem* TestWorkbench::setupCommandBars() const TYPESYSTEM_SOURCE_ABSTRACT(Gui::PythonBaseWorkbench, Gui::Workbench) -PythonBaseWorkbench::PythonBaseWorkbench() - : _menuBar(nullptr), _contextMenu(nullptr), _toolBar(nullptr), _commandBar(nullptr), _workbenchPy(nullptr) -{ -} +PythonBaseWorkbench::PythonBaseWorkbench() = default; PythonBaseWorkbench::~PythonBaseWorkbench() { diff --git a/src/Gui/Workbench.h b/src/Gui/Workbench.h index d6e3ccc3c1..46fe9038b1 100644 --- a/src/Gui/Workbench.h +++ b/src/Gui/Workbench.h @@ -289,11 +289,11 @@ protected: DockWindowItems* setupDockWindows() const override; protected: - MenuItem* _menuBar; - MenuItem* _contextMenu; - ToolBarItem* _toolBar; - ToolBarItem* _commandBar; - Base::PyObjectBase* _workbenchPy; + MenuItem* _menuBar{nullptr}; + MenuItem* _contextMenu{nullptr}; + ToolBarItem* _toolBar{nullptr}; + ToolBarItem* _commandBar{nullptr}; + Base::PyObjectBase* _workbenchPy{nullptr}; }; class GuiExport PythonBlankWorkbench : public PythonBaseWorkbench diff --git a/src/Gui/WorkbenchManager.cpp b/src/Gui/WorkbenchManager.cpp index 83dd266154..af9dc5dbda 100644 --- a/src/Gui/WorkbenchManager.cpp +++ b/src/Gui/WorkbenchManager.cpp @@ -48,9 +48,7 @@ void WorkbenchManager::destruct() _instance = nullptr; } -WorkbenchManager::WorkbenchManager() : _activeWorkbench(nullptr) -{ -} +WorkbenchManager::WorkbenchManager() = default; WorkbenchManager::~WorkbenchManager() { diff --git a/src/Gui/WorkbenchManager.h b/src/Gui/WorkbenchManager.h index f7482ffc43..f5818c1fb8 100644 --- a/src/Gui/WorkbenchManager.h +++ b/src/Gui/WorkbenchManager.h @@ -25,6 +25,9 @@ #define GUI_WORKBENCHMANAGER_H #include +#include +#include +#include namespace Gui { @@ -67,7 +70,7 @@ protected: private: static WorkbenchManager* _instance; - Workbench* _activeWorkbench; + Workbench* _activeWorkbench{nullptr}; std::map _workbenches; };