diff --git a/src/Gui/3Dconnexion/GuiAbstractNativeEvent.h b/src/Gui/3Dconnexion/GuiAbstractNativeEvent.h index 81785569a0..5321dd9621 100644 --- a/src/Gui/3Dconnexion/GuiAbstractNativeEvent.h +++ b/src/Gui/3Dconnexion/GuiAbstractNativeEvent.h @@ -36,7 +36,7 @@ namespace Gui { Q_OBJECT public: - GuiAbstractNativeEvent(GUIApplicationNativeEventAware *app); + explicit GuiAbstractNativeEvent(GUIApplicationNativeEventAware *app); ~GuiAbstractNativeEvent() override =0; virtual void initSpaceball(QMainWindow *window)=0; private: diff --git a/src/Gui/3Dconnexion/GuiNativeEventMac.h b/src/Gui/3Dconnexion/GuiNativeEventMac.h index 059da6a64a..2bfda80bea 100644 --- a/src/Gui/3Dconnexion/GuiNativeEventMac.h +++ b/src/Gui/3Dconnexion/GuiNativeEventMac.h @@ -61,7 +61,7 @@ namespace Gui { Q_OBJECT public: - GuiNativeEvent(GUIApplicationNativeEventAware *app); + explicit GuiNativeEvent(GUIApplicationNativeEventAware *app); ~GuiNativeEvent() override; void initSpaceball(QMainWindow *window) final; private: diff --git a/src/Gui/Action.cpp b/src/Gui/Action.cpp index 3b80571c8b..f80458abef 100644 --- a/src/Gui/Action.cpp +++ b/src/Gui/Action.cpp @@ -384,7 +384,7 @@ namespace Gui { class WorkbenchActionEvent : public QEvent { public: - WorkbenchActionEvent(QAction* a) + explicit WorkbenchActionEvent(QAction* a) : QEvent(QEvent::User), act(a) { } ~WorkbenchActionEvent() override diff --git a/src/Gui/ActiveObjectList.h b/src/Gui/ActiveObjectList.h index c20f7917ad..e392c97337 100644 --- a/src/Gui/ActiveObjectList.h +++ b/src/Gui/ActiveObjectList.h @@ -51,7 +51,7 @@ namespace Gui class GuiExport ActiveObjectList { public: - ActiveObjectList(Document *doc) + explicit ActiveObjectList(Document *doc) :_Doc(doc) {} diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index 58f3b30cce..2220dbbd2e 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -160,7 +160,7 @@ public: // Pimpl class struct ApplicationP { - ApplicationP(bool GUIenabled) : + explicit ApplicationP(bool GUIenabled) : activeDocument(nullptr), editDocument(nullptr), isClosing(false), diff --git a/src/Gui/Application.h b/src/Gui/Application.h index 36980a4bad..4ad59f9f3f 100644 --- a/src/Gui/Application.h +++ b/src/Gui/Application.h @@ -55,7 +55,7 @@ class GuiExport Application { public: /// construction - Application(bool GUIenabled); + explicit Application(bool GUIenabled); /// destruction ~Application(); diff --git a/src/Gui/Command.h b/src/Gui/Command.h index 3525304121..7d7ba18409 100644 --- a/src/Gui/Command.h +++ b/src/Gui/Command.h @@ -232,7 +232,7 @@ void CreateLinkCommands(); class GuiExport CommandBase { protected: - CommandBase(const char* sMenu, const char* sToolTip=nullptr, const char* sWhat=nullptr, + explicit CommandBase(const char* sMenu, const char* sToolTip=nullptr, const char* sWhat=nullptr, const char* sStatus=nullptr, const char* sPixmap=nullptr, const char* sAccel=nullptr); virtual ~CommandBase(); @@ -313,7 +313,7 @@ protected: class GuiExport Command : public CommandBase { protected: - Command(const char* name); + explicit Command(const char* name); ~Command() override; protected: @@ -627,7 +627,7 @@ private: class GuiExport GroupCommand : public Command { public: /// Constructor - GroupCommand(const char *name); + explicit GroupCommand(const char *name); /** Add child command * @param cmd: child command. Pass null pointer to add a separator. @@ -770,7 +770,7 @@ protected: class MacroCommand: public Command { public: - MacroCommand(const char* name, bool system = false); + explicit MacroCommand(const char* name, bool system = false); ~MacroCommand() override; protected: diff --git a/src/Gui/CommandTest.cpp b/src/Gui/CommandTest.cpp index dbfb71b408..d0a7a7c6c1 100644 --- a/src/Gui/CommandTest.cpp +++ b/src/Gui/CommandTest.cpp @@ -564,7 +564,7 @@ CmdTestProgress5::CmdTestProgress5() class BarThread : public QThread { public: - BarThread(unsigned long s) : steps(s) + explicit BarThread(unsigned long s) : steps(s) { } ~BarThread() override diff --git a/src/Gui/DAGView/DAGModel.h b/src/Gui/DAGView/DAGModel.h index f8f0adfdef..e29eb03e9e 100644 --- a/src/Gui/DAGView/DAGModel.h +++ b/src/Gui/DAGView/DAGModel.h @@ -52,7 +52,7 @@ namespace Gui { Q_OBJECT public: - LineEdit(QWidget *parentIn = nullptr); + explicit LineEdit(QWidget *parentIn = nullptr); Q_SIGNALS: void acceptedSignal(); void rejectedSignal(); diff --git a/src/Gui/DAGView/DAGModelGraph.h b/src/Gui/DAGView/DAGModelGraph.h index e6174652e2..166a797176 100644 --- a/src/Gui/DAGView/DAGModelGraph.h +++ b/src/Gui/DAGView/DAGModelGraph.h @@ -134,7 +134,7 @@ namespace Gui template class Edge_writer { public: - Edge_writer(const GraphEW &graphEWIn) : graphEW(graphEWIn) {} + explicit Edge_writer(const GraphEW &graphEWIn) : graphEW(graphEWIn) {} template void operator()(std::ostream& out, const EdgeW& /*edgeW*/) const { @@ -149,7 +149,7 @@ namespace Gui template class Vertex_writer { public: - Vertex_writer(const GraphVW &graphVWIn) : graphVW(graphVWIn) {} + explicit Vertex_writer(const GraphVW &graphVWIn) : graphVW(graphVWIn) {} template void operator()(std::ostream& out, const VertexW& vertexW) const { @@ -176,7 +176,7 @@ namespace Gui typedef boost::graph_traits::vertex_descriptor GraphInVertex; typedef std::vector GraphInVertices; public: - RakeLeaves(const GraphIn &graphIn) : graph(graphIn) {} + explicit RakeLeaves(const GraphIn &graphIn) : graph(graphIn) {} GraphInVertices operator()() const { GraphInVertices out; @@ -198,7 +198,7 @@ namespace Gui typedef boost::graph_traits::vertex_descriptor GraphInVertex; typedef std::vector GraphInVertices; public: - DigRoots(const GraphIn &graphIn) : graph(graphIn) {} + explicit DigRoots(const GraphIn &graphIn) : graph(graphIn) {} GraphInVertices operator()() const { GraphInVertices out; @@ -218,7 +218,7 @@ namespace Gui class ConnectionVisitor : public boost::default_bfs_visitor { public: - ConnectionVisitor(std::vector &verticesIn) : vertices(verticesIn){} + explicit ConnectionVisitor(std::vector &verticesIn) : vertices(verticesIn){} template void discover_vertex(TVertex vertex, TGraph &graph) diff --git a/src/Gui/DAGView/DAGRectItem.h b/src/Gui/DAGView/DAGRectItem.h index c78c489c91..fe88a15945 100644 --- a/src/Gui/DAGView/DAGRectItem.h +++ b/src/Gui/DAGView/DAGRectItem.h @@ -37,7 +37,7 @@ namespace Gui class RectItem : public QGraphicsRectItem { public: - RectItem(QGraphicsItem* parent = nullptr); + explicit RectItem(QGraphicsItem* parent = nullptr); void setBackgroundBrush(const QBrush &brushIn){backgroundBrush = brushIn;} void setEditingBrush(const QBrush &brushIn){editBrush = brushIn;} void preHighlightOn(){preSelected = true;} diff --git a/src/Gui/DAGView/DAGView.h b/src/Gui/DAGView/DAGView.h index a205c2af15..efd1d145be 100644 --- a/src/Gui/DAGView/DAGView.h +++ b/src/Gui/DAGView/DAGView.h @@ -43,7 +43,7 @@ namespace Gui { Q_OBJECT public: - View(QWidget *parentIn = nullptr); + explicit View(QWidget *parentIn = nullptr); ~View() override; public Q_SLOTS: @@ -66,7 +66,7 @@ namespace Gui { Q_OBJECT public: - DockWindow(Gui::Document* gDocumentIn = nullptr, QWidget *parent = nullptr); + explicit DockWindow(Gui::Document* gDocumentIn = nullptr, QWidget *parent = nullptr); ~DockWindow() override{} private: diff --git a/src/Gui/DlgActionsImp.h b/src/Gui/DlgActionsImp.h index 534199b105..53e01a7925 100644 --- a/src/Gui/DlgActionsImp.h +++ b/src/Gui/DlgActionsImp.h @@ -53,7 +53,7 @@ class DlgCustomActionsImp : public CustomizeActionPage Q_OBJECT public: - DlgCustomActionsImp( QWidget* parent = nullptr ); + explicit DlgCustomActionsImp( QWidget* parent = nullptr ); ~DlgCustomActionsImp() override; Q_SIGNALS: @@ -96,7 +96,7 @@ class IconDialog : public QDialog Q_OBJECT public: - IconDialog(QWidget* parent); + explicit IconDialog(QWidget* parent); ~IconDialog() override; void resizeEvent(QResizeEvent*) override; QListWidgetItem* currentItem() const; diff --git a/src/Gui/DlgActivateWindowImp.h b/src/Gui/DlgActivateWindowImp.h index ef21145d32..6cdb3f4097 100644 --- a/src/Gui/DlgActivateWindowImp.h +++ b/src/Gui/DlgActivateWindowImp.h @@ -40,7 +40,7 @@ class DlgActivateWindowImp : public QDialog Q_OBJECT public: - DlgActivateWindowImp(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); + explicit DlgActivateWindowImp(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); ~DlgActivateWindowImp() override; protected: diff --git a/src/Gui/DlgCommandsImp.cpp b/src/Gui/DlgCommandsImp.cpp index b73166104f..ad3462b841 100644 --- a/src/Gui/DlgCommandsImp.cpp +++ b/src/Gui/DlgCommandsImp.cpp @@ -43,7 +43,7 @@ typedef std::vector< std::pair > GroupMap; struct GroupMap_find { const QLatin1String& item; - GroupMap_find(const QLatin1String& item) : item(item) {} + explicit GroupMap_find(const QLatin1String& item) : item(item) {} bool operator () (const std::pair& elem) const { return elem.first == item; diff --git a/src/Gui/DlgCommandsImp.h b/src/Gui/DlgCommandsImp.h index 87a09665b2..a3b79dfd89 100644 --- a/src/Gui/DlgCommandsImp.h +++ b/src/Gui/DlgCommandsImp.h @@ -46,7 +46,7 @@ class DlgCustomCommandsImp : public CustomizeActionPage Q_OBJECT public: - DlgCustomCommandsImp(QWidget* parent = nullptr); + explicit DlgCustomCommandsImp(QWidget* parent = nullptr); ~DlgCustomCommandsImp() override; protected Q_SLOTS: diff --git a/src/Gui/DlgCreateNewPreferencePackImp.h b/src/Gui/DlgCreateNewPreferencePackImp.h index 86e4b2d4b1..d154d31808 100644 --- a/src/Gui/DlgCreateNewPreferencePackImp.h +++ b/src/Gui/DlgCreateNewPreferencePackImp.h @@ -51,7 +51,7 @@ class GuiExport DlgCreateNewPreferencePackImp : public QDialog public: - DlgCreateNewPreferencePackImp(QWidget* parent = nullptr); + explicit DlgCreateNewPreferencePackImp(QWidget* parent = nullptr); ~DlgCreateNewPreferencePackImp() override; void setPreferencePackTemplates(const std::vector &availableTemplates); diff --git a/src/Gui/DlgCustomizeImp.h b/src/Gui/DlgCustomizeImp.h index 217a06a61b..320ca849cb 100644 --- a/src/Gui/DlgCustomizeImp.h +++ b/src/Gui/DlgCustomizeImp.h @@ -51,7 +51,7 @@ class DlgCustomizeImp : public QDialog Q_OBJECT public: - DlgCustomizeImp(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); + explicit DlgCustomizeImp(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); ~DlgCustomizeImp() override; static void addPage(const char* className); diff --git a/src/Gui/DlgCustomizeSpaceball.h b/src/Gui/DlgCustomizeSpaceball.h index 4f84bed9e7..d3950b6c95 100644 --- a/src/Gui/DlgCustomizeSpaceball.h +++ b/src/Gui/DlgCustomizeSpaceball.h @@ -44,7 +44,7 @@ namespace Gui { Q_OBJECT public: - ButtonView(QWidget *parent = nullptr); + explicit ButtonView(QWidget *parent = nullptr); void selectButton(int number); Q_SIGNALS: void changeCommandSelection(const QString& commandName); @@ -59,7 +59,7 @@ namespace Gui { Q_OBJECT public: - ButtonModel(QObject *parent); + explicit ButtonModel(QObject *parent); int rowCount(const QModelIndex &parent = QModelIndex()) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; void insertButtonRows(int number); @@ -79,7 +79,7 @@ namespace Gui { Q_OBJECT public: - CommandView(QWidget *parent = nullptr); + explicit CommandView(QWidget *parent = nullptr); public Q_SLOTS: void goChangeCommandSelection(const QString& commandName); private Q_SLOTS: @@ -93,7 +93,7 @@ namespace Gui public: enum NodeType {RootType, GroupType, CommandType}; - CommandNode(NodeType typeIn); + explicit CommandNode(NodeType typeIn); ~CommandNode(); NodeType nodeType; @@ -107,7 +107,7 @@ namespace Gui { Q_OBJECT public: - CommandModel(QObject *parent = nullptr); + explicit CommandModel(QObject *parent = nullptr); ~CommandModel() override; QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override; QModelIndex parent(const QModelIndex &index) const override; @@ -144,7 +144,7 @@ namespace Gui { Q_OBJECT public: - DlgCustomizeSpaceball(QWidget *parent = nullptr); + explicit DlgCustomizeSpaceball(QWidget *parent = nullptr); ~DlgCustomizeSpaceball() override; protected: void changeEvent(QEvent *e) override; diff --git a/src/Gui/DlgDisplayPropertiesImp.h b/src/Gui/DlgDisplayPropertiesImp.h index 06c518408c..a634ac121d 100644 --- a/src/Gui/DlgDisplayPropertiesImp.h +++ b/src/Gui/DlgDisplayPropertiesImp.h @@ -56,7 +56,7 @@ class DlgDisplayPropertiesImp : public QDialog, Q_OBJECT public: - DlgDisplayPropertiesImp(bool floating, QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); + explicit DlgDisplayPropertiesImp(bool floating, QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); ~DlgDisplayPropertiesImp() override; /// Observer message from the Selection void OnChange(Gui::SelectionSingleton::SubjectType &rCaller, diff --git a/src/Gui/DlgEditorImp.h b/src/Gui/DlgEditorImp.h index ab23edbc34..199e2ce085 100644 --- a/src/Gui/DlgEditorImp.h +++ b/src/Gui/DlgEditorImp.h @@ -45,7 +45,7 @@ class DlgSettingsEditorImp : public PreferencePage Q_OBJECT public: - DlgSettingsEditorImp( QWidget* parent = nullptr ); + explicit DlgSettingsEditorImp( QWidget* parent = nullptr ); ~DlgSettingsEditorImp() override; public: diff --git a/src/Gui/DlgKeyboardImp.cpp b/src/Gui/DlgKeyboardImp.cpp index 3f3db30503..ba3aa265a5 100644 --- a/src/Gui/DlgKeyboardImp.cpp +++ b/src/Gui/DlgKeyboardImp.cpp @@ -46,7 +46,7 @@ typedef std::vector< std::pair > GroupMap; struct GroupMap_find { const QLatin1String& item; - GroupMap_find(const QLatin1String& item) : item(item) {} + explicit GroupMap_find(const QLatin1String& item) : item(item) {} bool operator () (const std::pair& elem) const { return elem.first == item; diff --git a/src/Gui/DlgKeyboardImp.h b/src/Gui/DlgKeyboardImp.h index a8787749bd..e66162e829 100644 --- a/src/Gui/DlgKeyboardImp.h +++ b/src/Gui/DlgKeyboardImp.h @@ -45,7 +45,7 @@ class DlgCustomKeyboardImp : public CustomizeActionPage Q_OBJECT public: - DlgCustomKeyboardImp( QWidget* parent = nullptr ); + explicit DlgCustomKeyboardImp( QWidget* parent = nullptr ); ~DlgCustomKeyboardImp() override; protected: diff --git a/src/Gui/DlgMacroExecuteImp.h b/src/Gui/DlgMacroExecuteImp.h index a2092b6923..568d13120c 100644 --- a/src/Gui/DlgMacroExecuteImp.h +++ b/src/Gui/DlgMacroExecuteImp.h @@ -44,7 +44,7 @@ class DlgMacroExecuteImp : public QDialog, public Gui::WindowParameter Q_OBJECT public: - DlgMacroExecuteImp( QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags() ); + explicit DlgMacroExecuteImp(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); ~DlgMacroExecuteImp() override; void accept() override; diff --git a/src/Gui/DlgMacroRecordImp.h b/src/Gui/DlgMacroRecordImp.h index bf57651e8e..82bb6b8e8c 100644 --- a/src/Gui/DlgMacroRecordImp.h +++ b/src/Gui/DlgMacroRecordImp.h @@ -42,7 +42,7 @@ class DlgMacroRecordImp : public QDialog, public Gui::WindowParameter Q_OBJECT public: - DlgMacroRecordImp( QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags() ); + explicit DlgMacroRecordImp( QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags() ); ~DlgMacroRecordImp() override; protected Q_SLOTS: diff --git a/src/Gui/DlgMaterialPropertiesImp.h b/src/Gui/DlgMaterialPropertiesImp.h index 04e8ee34b7..dd94d88bdc 100644 --- a/src/Gui/DlgMaterialPropertiesImp.h +++ b/src/Gui/DlgMaterialPropertiesImp.h @@ -39,7 +39,7 @@ class DlgMaterialPropertiesImp : public QDialog Q_OBJECT public: - DlgMaterialPropertiesImp(const std::string& mat, QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); + explicit DlgMaterialPropertiesImp(const std::string& mat, QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); ~DlgMaterialPropertiesImp() override; void setViewProviders(const std::vector&); QColor diffuseColor() const; diff --git a/src/Gui/DlgParameterImp.h b/src/Gui/DlgParameterImp.h index 15d01aa834..9150e69021 100644 --- a/src/Gui/DlgParameterImp.h +++ b/src/Gui/DlgParameterImp.h @@ -47,7 +47,7 @@ class GuiExport DlgParameterImp : public QDialog Q_OBJECT public: - DlgParameterImp( QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags() ); + explicit DlgParameterImp( QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags() ); ~DlgParameterImp() override; void accept() override; @@ -95,7 +95,7 @@ class ParameterGroup : public QTreeWidget Q_OBJECT public: - ParameterGroup( QWidget * parent = nullptr ); + explicit ParameterGroup( QWidget * parent = nullptr ); ~ParameterGroup() override; protected: @@ -147,7 +147,7 @@ class ParameterValue : public QTreeWidget Q_OBJECT public: - ParameterValue( QWidget * parent = nullptr ); + explicit ParameterValue( QWidget * parent = nullptr ); ~ParameterValue() override; /** Sets the current parameter group that is displayed. */ diff --git a/src/Gui/DlgPreferencesImp.h b/src/Gui/DlgPreferencesImp.h index 1e53dfba64..4e85d26a7b 100644 --- a/src/Gui/DlgPreferencesImp.h +++ b/src/Gui/DlgPreferencesImp.h @@ -118,7 +118,7 @@ public: static void getGroupData(const std::string& group, std::string& icon, QString& tip); static void reloadSettings(); - DlgPreferencesImp(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); + explicit DlgPreferencesImp(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); ~DlgPreferencesImp() override; void accept() override; diff --git a/src/Gui/DlgPropertyLink.cpp b/src/Gui/DlgPropertyLink.cpp index 7830e0b029..830e4dbcfe 100644 --- a/src/Gui/DlgPropertyLink.cpp +++ b/src/Gui/DlgPropertyLink.cpp @@ -52,7 +52,7 @@ using namespace Gui::Dialog; class ItemDelegate: public QStyledItemDelegate { public: - ItemDelegate(QObject* parent=nullptr): QStyledItemDelegate(parent) {} + explicit ItemDelegate(QObject* parent=nullptr): QStyledItemDelegate(parent) {} QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override diff --git a/src/Gui/DlgReportViewImp.h b/src/Gui/DlgReportViewImp.h index 5bba353f5f..ebecb65fdb 100644 --- a/src/Gui/DlgReportViewImp.h +++ b/src/Gui/DlgReportViewImp.h @@ -40,7 +40,7 @@ class DlgReportViewImp : public PreferencePage Q_OBJECT public: - DlgReportViewImp( QWidget* parent = nullptr ); + explicit DlgReportViewImp( QWidget* parent = nullptr ); ~DlgReportViewImp() override; void saveSettings() override; diff --git a/src/Gui/DlgRevertToBackupConfigImp.h b/src/Gui/DlgRevertToBackupConfigImp.h index 90135dd79f..0728304014 100644 --- a/src/Gui/DlgRevertToBackupConfigImp.h +++ b/src/Gui/DlgRevertToBackupConfigImp.h @@ -39,7 +39,7 @@ class DlgRevertToBackupConfigImp : public QDialog Q_OBJECT public: - DlgRevertToBackupConfigImp( QWidget* parent = nullptr ); + explicit DlgRevertToBackupConfigImp( QWidget* parent = nullptr ); ~DlgRevertToBackupConfigImp() override; public Q_SLOTS: diff --git a/src/Gui/DlgRunExternal.h b/src/Gui/DlgRunExternal.h index 5b5c9056d4..2dbbd03372 100644 --- a/src/Gui/DlgRunExternal.h +++ b/src/Gui/DlgRunExternal.h @@ -41,7 +41,7 @@ class GuiExport DlgRunExternal : public QDialog Q_OBJECT public: - DlgRunExternal(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); + explicit DlgRunExternal(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); ~DlgRunExternal() override; int Do(); diff --git a/src/Gui/DlgSettings3DViewImp.h b/src/Gui/DlgSettings3DViewImp.h index 65d8c265eb..5c8ade7c74 100644 --- a/src/Gui/DlgSettings3DViewImp.h +++ b/src/Gui/DlgSettings3DViewImp.h @@ -43,7 +43,7 @@ class DlgSettings3DViewImp : public PreferencePage Q_OBJECT public: - DlgSettings3DViewImp(QWidget* parent = nullptr); + explicit DlgSettings3DViewImp(QWidget* parent = nullptr); ~DlgSettings3DViewImp() override; void saveSettings() override; diff --git a/src/Gui/DlgSettingsCacheDirectory.h b/src/Gui/DlgSettingsCacheDirectory.h index 9c7b1b1c0c..19fcf17ab4 100644 --- a/src/Gui/DlgSettingsCacheDirectory.h +++ b/src/Gui/DlgSettingsCacheDirectory.h @@ -41,7 +41,7 @@ class DlgSettingsCacheDirectory : public PreferencePage Q_OBJECT public: - DlgSettingsCacheDirectory(QWidget* parent = nullptr); + explicit DlgSettingsCacheDirectory(QWidget* parent = nullptr); ~DlgSettingsCacheDirectory() override; void saveSettings() override; diff --git a/src/Gui/DlgSettingsColorGradientImp.h b/src/Gui/DlgSettingsColorGradientImp.h index 30726c295d..3f39463738 100644 --- a/src/Gui/DlgSettingsColorGradientImp.h +++ b/src/Gui/DlgSettingsColorGradientImp.h @@ -44,7 +44,7 @@ class DlgSettingsColorGradientImp : public QDialog Q_OBJECT public: - DlgSettingsColorGradientImp(const App::ColorGradient& cg, + explicit DlgSettingsColorGradientImp(const App::ColorGradient& cg, QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); ~DlgSettingsColorGradientImp() override; diff --git a/src/Gui/DlgSettingsDocumentImp.h b/src/Gui/DlgSettingsDocumentImp.h index ad321a0c50..71c922b6f5 100644 --- a/src/Gui/DlgSettingsDocumentImp.h +++ b/src/Gui/DlgSettingsDocumentImp.h @@ -41,7 +41,7 @@ class DlgSettingsDocumentImp : public PreferencePage Q_OBJECT public: - DlgSettingsDocumentImp( QWidget* parent = nullptr ); + explicit DlgSettingsDocumentImp( QWidget* parent = nullptr ); ~DlgSettingsDocumentImp() override; void saveSettings() override; diff --git a/src/Gui/DlgSettingsImageImp.h b/src/Gui/DlgSettingsImageImp.h index 1d60cae8a7..d9fb73a200 100644 --- a/src/Gui/DlgSettingsImageImp.h +++ b/src/Gui/DlgSettingsImageImp.h @@ -43,7 +43,7 @@ class DlgSettingsImageImp : public QWidget Q_OBJECT public: - DlgSettingsImageImp( QWidget* parent = nullptr ); + explicit DlgSettingsImageImp( QWidget* parent = nullptr ); ~DlgSettingsImageImp() override; /** @name Image dimensions */ diff --git a/src/Gui/DlgSettingsLazyLoadedImp.h b/src/Gui/DlgSettingsLazyLoadedImp.h index 1bfb59d79a..a81a21ec91 100644 --- a/src/Gui/DlgSettingsLazyLoadedImp.h +++ b/src/Gui/DlgSettingsLazyLoadedImp.h @@ -44,7 +44,7 @@ class DlgSettingsLazyLoadedImp : public PreferencePage Q_OBJECT public: - DlgSettingsLazyLoadedImp( QWidget* parent = nullptr ); + explicit DlgSettingsLazyLoadedImp( QWidget* parent = nullptr ); ~DlgSettingsLazyLoadedImp() override; void saveSettings() override; diff --git a/src/Gui/DlgSettingsMacroImp.h b/src/Gui/DlgSettingsMacroImp.h index 9dd5f53d8a..cff2bbdfa3 100644 --- a/src/Gui/DlgSettingsMacroImp.h +++ b/src/Gui/DlgSettingsMacroImp.h @@ -41,7 +41,7 @@ class DlgSettingsMacroImp : public PreferencePage Q_OBJECT public: - DlgSettingsMacroImp( QWidget* parent = nullptr ); + explicit DlgSettingsMacroImp( QWidget* parent = nullptr ); ~DlgSettingsMacroImp() override; void saveSettings() override; diff --git a/src/Gui/DlgSettingsNavigation.h b/src/Gui/DlgSettingsNavigation.h index 8ab63ceeb8..bedb578d9e 100644 --- a/src/Gui/DlgSettingsNavigation.h +++ b/src/Gui/DlgSettingsNavigation.h @@ -44,7 +44,7 @@ class DlgSettingsNavigation : public PreferencePage Q_OBJECT public: - DlgSettingsNavigation(QWidget* parent = nullptr); + explicit DlgSettingsNavigation(QWidget* parent = nullptr); ~DlgSettingsNavigation() override; void saveSettings() override; @@ -68,7 +68,7 @@ class CameraDialog : public QDialog Q_OBJECT public: - CameraDialog(QWidget* parent=nullptr); + explicit CameraDialog(QWidget* parent=nullptr); ~CameraDialog() override; void setValues(double q0, double q1, double q2, double q3); void getValues(double& q0, double& q1, double& q2, double& q3) const; diff --git a/src/Gui/DlgSettingsPythonConsole.h b/src/Gui/DlgSettingsPythonConsole.h index 15decfe080..4afaebf92e 100644 --- a/src/Gui/DlgSettingsPythonConsole.h +++ b/src/Gui/DlgSettingsPythonConsole.h @@ -41,7 +41,7 @@ class DlgSettingsPythonConsole : public PreferencePage Q_OBJECT public: - DlgSettingsPythonConsole(QWidget* parent = nullptr); + explicit DlgSettingsPythonConsole(QWidget* parent = nullptr); ~DlgSettingsPythonConsole() override; void saveSettings() override; diff --git a/src/Gui/DlgSettingsUnitsImp.h b/src/Gui/DlgSettingsUnitsImp.h index 66c52ffd74..5fe7c33bc2 100644 --- a/src/Gui/DlgSettingsUnitsImp.h +++ b/src/Gui/DlgSettingsUnitsImp.h @@ -40,7 +40,7 @@ class DlgSettingsUnitsImp : public PreferencePage Q_OBJECT public: - DlgSettingsUnitsImp(QWidget* parent = nullptr); + explicit DlgSettingsUnitsImp(QWidget* parent = nullptr); ~DlgSettingsUnitsImp() override; void saveSettings() override; diff --git a/src/Gui/DlgSettingsViewColor.h b/src/Gui/DlgSettingsViewColor.h index 6d28f78cfe..394c13892e 100644 --- a/src/Gui/DlgSettingsViewColor.h +++ b/src/Gui/DlgSettingsViewColor.h @@ -41,7 +41,7 @@ class DlgSettingsViewColor : public PreferencePage Q_OBJECT public: - DlgSettingsViewColor(QWidget* parent = nullptr); + explicit DlgSettingsViewColor(QWidget* parent = nullptr); ~DlgSettingsViewColor() override; void saveSettings() override; diff --git a/src/Gui/DlgToolbarsImp.cpp b/src/Gui/DlgToolbarsImp.cpp index b6a862dacc..99e2642bcb 100644 --- a/src/Gui/DlgToolbarsImp.cpp +++ b/src/Gui/DlgToolbarsImp.cpp @@ -49,7 +49,7 @@ typedef std::vector< std::pair > GroupMap; struct GroupMap_find { const QLatin1String& item; - GroupMap_find(const QLatin1String& item) : item(item) {} + explicit GroupMap_find(const QLatin1String& item) : item(item) {} bool operator () (const std::pair& elem) const { return elem.first == item; diff --git a/src/Gui/DlgToolbarsImp.h b/src/Gui/DlgToolbarsImp.h index 79db41a8c8..55ffb692fc 100644 --- a/src/Gui/DlgToolbarsImp.h +++ b/src/Gui/DlgToolbarsImp.h @@ -46,7 +46,7 @@ class DlgCustomToolbars : public CustomizeActionPage protected: enum Type { Toolbar, Toolboxbar }; - DlgCustomToolbars(Type, QWidget* parent = nullptr); + explicit DlgCustomToolbars(Type, QWidget* parent = nullptr); ~DlgCustomToolbars() override; protected Q_SLOTS: @@ -94,7 +94,7 @@ class DlgCustomToolbarsImp : public DlgCustomToolbars Q_OBJECT public: - DlgCustomToolbarsImp(QWidget* parent = nullptr); + explicit DlgCustomToolbarsImp(QWidget* parent = nullptr); ~DlgCustomToolbarsImp() override; protected: @@ -126,7 +126,7 @@ class DlgCustomToolBoxbarsImp : public DlgCustomToolbars Q_OBJECT public: - DlgCustomToolBoxbarsImp(QWidget* parent = nullptr); + explicit DlgCustomToolBoxbarsImp(QWidget* parent = nullptr); ~DlgCustomToolBoxbarsImp() override; protected: diff --git a/src/Gui/DlgUndoRedo.h b/src/Gui/DlgUndoRedo.h index 35889c4928..e35714a2a9 100644 --- a/src/Gui/DlgUndoRedo.h +++ b/src/Gui/DlgUndoRedo.h @@ -37,7 +37,7 @@ class UndoDialog : public QMenu Q_OBJECT public: - UndoDialog( QWidget* parent = nullptr ); + explicit UndoDialog( QWidget* parent = nullptr ); ~UndoDialog() override; protected Q_SLOTS: @@ -53,7 +53,7 @@ class RedoDialog : public QMenu Q_OBJECT public: - RedoDialog( QWidget* parent = nullptr ); + explicit RedoDialog( QWidget* parent = nullptr ); ~RedoDialog() override; protected Q_SLOTS: diff --git a/src/Gui/DlgUnitsCalculatorImp.h b/src/Gui/DlgUnitsCalculatorImp.h index 9b1b7f120d..4f9f2da786 100644 --- a/src/Gui/DlgUnitsCalculatorImp.h +++ b/src/Gui/DlgUnitsCalculatorImp.h @@ -42,7 +42,7 @@ class DlgUnitsCalculator : public QDialog Q_OBJECT public: - DlgUnitsCalculator(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); + explicit DlgUnitsCalculator(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); ~DlgUnitsCalculator() override; protected: diff --git a/src/Gui/DlgWorkbenchesImp.h b/src/Gui/DlgWorkbenchesImp.h index 12d8b2e621..dc3cf907e3 100644 --- a/src/Gui/DlgWorkbenchesImp.h +++ b/src/Gui/DlgWorkbenchesImp.h @@ -40,7 +40,7 @@ class DlgWorkbenchesImp : public CustomizeActionPage Q_OBJECT public: - DlgWorkbenchesImp(QWidget* parent = nullptr); + explicit DlgWorkbenchesImp(QWidget* parent = nullptr); ~DlgWorkbenchesImp() override; static QStringList load_enabled_workbenches(); static QStringList load_disabled_workbenches(); diff --git a/src/Gui/DockWindow.h b/src/Gui/DockWindow.h index c598da023e..68db73da26 100644 --- a/src/Gui/DockWindow.h +++ b/src/Gui/DockWindow.h @@ -53,7 +53,7 @@ public: * the view will attach to the active document. Be aware there isn't * always an active document available! */ - DockWindow ( Gui::Document* pcDocument=nullptr, QWidget *parent=nullptr ); + explicit DockWindow ( Gui::Document* pcDocument=nullptr, QWidget *parent=nullptr ); /** View destructor * Detach the view from the document, if attached. */ diff --git a/src/Gui/DocumentModel.cpp b/src/Gui/DocumentModel.cpp index 3abcf1d6b4..a528388a06 100644 --- a/src/Gui/DocumentModel.cpp +++ b/src/Gui/DocumentModel.cpp @@ -137,7 +137,7 @@ namespace Gui { public: const Gui::Document& d; - DocumentIndex(const Gui::Document& d) : d(d) + explicit DocumentIndex(const Gui::Document& d) : d(d) { if (!documentIcon) documentIcon = new QIcon(Gui::BitmapFactory().pixmap("Document")); diff --git a/src/Gui/DocumentModel.h b/src/Gui/DocumentModel.h index 9a55bc94f3..1de48eb7ff 100644 --- a/src/Gui/DocumentModel.h +++ b/src/Gui/DocumentModel.h @@ -38,7 +38,7 @@ class ViewProviderDocumentObject; class DocumentModel : public QAbstractItemModel { public: - DocumentModel(QObject* parent); + explicit DocumentModel(QObject* parent); ~DocumentModel() override; int columnCount (const QModelIndex & parent = QModelIndex()) const override; diff --git a/src/Gui/DocumentObserver.h b/src/Gui/DocumentObserver.h index eb405f9feb..ca9bf81f10 100644 --- a/src/Gui/DocumentObserver.h +++ b/src/Gui/DocumentObserver.h @@ -46,9 +46,9 @@ public: /*! Constructor */ DocumentT(); /*! Constructor */ - DocumentT(Document*); + explicit DocumentT(Document*); /*! Constructor */ - DocumentT(const std::string&); + explicit DocumentT(const std::string&); /*! Constructor */ DocumentT(const DocumentT&); /*! Destructor */ @@ -90,7 +90,7 @@ public: /*! Constructor */ ViewProviderT(ViewProviderT &&); /*! Constructor */ - ViewProviderT(const ViewProviderDocumentObject*); + explicit ViewProviderT(const ViewProviderDocumentObject*); /*! Destructor */ ~ViewProviderT(); /*! Assignment operator */ @@ -134,7 +134,7 @@ private: class GuiExport DocumentWeakPtrT { public: - DocumentWeakPtrT(Gui::Document*) noexcept; + explicit DocumentWeakPtrT(Gui::Document*) noexcept; ~DocumentWeakPtrT(); /*! @@ -173,7 +173,7 @@ private: class GuiExport ViewProviderWeakPtrT { public: - ViewProviderWeakPtrT(ViewProviderDocumentObject*); + explicit ViewProviderWeakPtrT(ViewProviderDocumentObject*); ~ViewProviderWeakPtrT(); /*! @@ -236,7 +236,7 @@ template class WeakPtrT { public: - WeakPtrT(T* t) : ptr(t) { + explicit WeakPtrT(T* t) : ptr(t) { } ~WeakPtrT() { } @@ -319,7 +319,7 @@ class GuiExport DocumentObserver public: /// Constructor DocumentObserver(); - DocumentObserver(Document*); + explicit DocumentObserver(Document*); virtual ~DocumentObserver(); /** Attaches to another document, the old document diff --git a/src/Gui/DocumentRecovery.h b/src/Gui/DocumentRecovery.h index 615d1816f0..46fb2696b5 100644 --- a/src/Gui/DocumentRecovery.h +++ b/src/Gui/DocumentRecovery.h @@ -43,7 +43,7 @@ class DocumentRecovery : public QDialog Q_OBJECT public: - DocumentRecovery(const QList&, QWidget* parent = nullptr); + explicit DocumentRecovery(const QList&, QWidget* parent = nullptr); ~DocumentRecovery() override; void accept() override; diff --git a/src/Gui/DownloadItem.h b/src/Gui/DownloadItem.h index 6344841ce6..793b22f5a2 100644 --- a/src/Gui/DownloadItem.h +++ b/src/Gui/DownloadItem.h @@ -42,7 +42,7 @@ class EditTableView : public QTableView Q_OBJECT public: - EditTableView(QWidget *parent = nullptr); + explicit EditTableView(QWidget *parent = nullptr); void keyPressEvent(QKeyEvent *event) override; public Q_SLOTS: @@ -55,7 +55,7 @@ class SqueezeLabel : public QLabel Q_OBJECT public: - SqueezeLabel(QWidget *parent = nullptr); + explicit SqueezeLabel(QWidget *parent = nullptr); protected: void paintEvent(QPaintEvent *event) override; @@ -72,7 +72,7 @@ class AutoSaver : public QObject { Q_OBJECT public: - AutoSaver(QObject *parent); + explicit AutoSaver(QObject *parent); ~AutoSaver() override; void saveIfNecessary(); @@ -93,7 +93,7 @@ class NetworkAccessManager : public QNetworkAccessManager Q_OBJECT public: - NetworkAccessManager(QObject *parent = nullptr); + explicit NetworkAccessManager(QObject *parent = nullptr); private Q_SLOTS: void authenticationRequired(QNetworkReply *reply, QAuthenticator *auth); // clazy:exclude=overridden-signal @@ -114,7 +114,7 @@ Q_SIGNALS: void statusChanged(); public: - DownloadItem(QNetworkReply *reply = nullptr, bool requestFileName = false, QWidget *parent = nullptr); + explicit DownloadItem(QNetworkReply *reply = nullptr, bool requestFileName = false, QWidget *parent = nullptr); bool downloading() const; bool downloadedSuccessfully() const; diff --git a/src/Gui/DownloadManager.h b/src/Gui/DownloadManager.h index b172443aee..420cea2ab5 100644 --- a/src/Gui/DownloadManager.h +++ b/src/Gui/DownloadManager.h @@ -59,7 +59,7 @@ public: static DownloadManager* getInstance(); private: - DownloadManager(QWidget *parent = nullptr); + explicit DownloadManager(QWidget *parent = nullptr); ~DownloadManager() override; public: @@ -107,7 +107,7 @@ class DownloadModel : public QAbstractListModel Q_OBJECT public: - DownloadModel(DownloadManager *downloadManager, QObject *parent = nullptr); + explicit DownloadModel(DownloadManager *downloadManager, QObject *parent = nullptr); QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; int rowCount(const QModelIndex &parent = QModelIndex()) const override; bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override; diff --git a/src/Gui/EditorView.h b/src/Gui/EditorView.h index c57fb7554b..19a700246b 100644 --- a/src/Gui/EditorView.h +++ b/src/Gui/EditorView.h @@ -146,7 +146,7 @@ class SearchBar : public QWidget Q_OBJECT public: - SearchBar(QWidget* parent = nullptr); + explicit SearchBar(QWidget* parent = nullptr); void setEditor(QPlainTextEdit *textEdit); diff --git a/src/Gui/ExpressionBindingPy.h b/src/Gui/ExpressionBindingPy.h index 1dd18d6350..c68345a72b 100644 --- a/src/Gui/ExpressionBindingPy.h +++ b/src/Gui/ExpressionBindingPy.h @@ -33,7 +33,7 @@ class ExpressionBindingPy : public Py::PythonExtension public: static void init_type(); // announce properties and methods - ExpressionBindingPy(ExpressionBinding*); + explicit ExpressionBindingPy(ExpressionBinding*); ~ExpressionBindingPy() override; Py::Object repr() override; diff --git a/src/Gui/FileDialog.h b/src/Gui/FileDialog.h index f1f28fa4b2..871e3b8c68 100644 --- a/src/Gui/FileDialog.h +++ b/src/Gui/FileDialog.h @@ -76,7 +76,7 @@ public: static QString restoreLocation(); static void saveLocation(const QString&); - FileDialog(QWidget * parent = nullptr); + explicit FileDialog(QWidget * parent = nullptr); ~FileDialog() override; void accept() override; @@ -166,7 +166,7 @@ public: Q_PROPERTY(QString buttonText READ buttonText WRITE setButtonText NOTIFY buttonTextChanged) public: - FileChooser ( QWidget * parent = nullptr ); + explicit FileChooser ( QWidget * parent = nullptr ); ~FileChooser() override; /** diff --git a/src/Gui/GLPainter.h b/src/Gui/GLPainter.h index 7abdffedff..f6b3307eed 100644 --- a/src/Gui/GLPainter.h +++ b/src/Gui/GLPainter.h @@ -105,7 +105,7 @@ class GuiExport Rubberband : public Gui::GLGraphicsItem bool working, stipple; public: - Rubberband(View3DInventorViewer* v); + explicit Rubberband(View3DInventorViewer* v); Rubberband(); ~Rubberband() override; void setWorking(bool on); @@ -127,7 +127,7 @@ class GuiExport Polyline : public Gui::GLGraphicsItem GLPainter p; public: - Polyline(View3DInventorViewer* v); + explicit Polyline(View3DInventorViewer* v); Polyline(); ~Polyline() override; void setWorking(bool on); diff --git a/src/Gui/GestureNavigationStyle.cpp b/src/Gui/GestureNavigationStyle.cpp index 4080376b1e..7fa7c73675 100644 --- a/src/Gui/GestureNavigationStyle.cpp +++ b/src/Gui/GestureNavigationStyle.cpp @@ -222,7 +222,7 @@ class NS::NaviMachine : public sc::state_machine public: typedef sc::state_machine superclass; - NaviMachine(NS& ns) : ns(ns) {} + explicit NaviMachine(NS& ns) : ns(ns) {} NS& ns; public: @@ -238,7 +238,7 @@ class NS::IdleState : public sc::state public: typedef sc::custom_reaction reactions; - IdleState(my_context ctx):my_base(ctx) + explicit IdleState(my_context ctx):my_base(ctx) { auto &ns = this->outermost_context().ns; ns.setViewingMode(NavigationStyle::IDLE); @@ -347,7 +347,7 @@ private: int hold_timeout; //in milliseconds public: - AwaitingMoveState(my_context ctx):my_base(ctx) + explicit AwaitingMoveState(my_context ctx):my_base(ctx) { auto &ns = this->outermost_context().ns; if (ns.logging) @@ -486,7 +486,7 @@ private: SbVec2s base_pos; public: - RotateState(my_context ctx):my_base(ctx) + explicit RotateState(my_context ctx):my_base(ctx) { auto &ns = this->outermost_context().ns; ns.setViewingMode(NavigationStyle::DRAGGING); @@ -529,7 +529,7 @@ private: float ratio; public: - PanState(my_context ctx):my_base(ctx) + explicit PanState(my_context ctx):my_base(ctx) { auto &ns = this->outermost_context().ns; ns.setViewingMode(NavigationStyle::PANNING); @@ -576,7 +576,7 @@ private: float ratio; public: - StickyPanState(my_context ctx):my_base(ctx) + explicit StickyPanState(my_context ctx):my_base(ctx) { auto &ns = this->outermost_context().ns; ns.setViewingMode(NavigationStyle::PANNING); @@ -622,7 +622,7 @@ private: SbVec2s base_pos; public: - TiltState(my_context ctx):my_base(ctx) + explicit TiltState(my_context ctx):my_base(ctx) { auto &ns = this->outermost_context().ns; ns.setViewingMode(NavigationStyle::DRAGGING); @@ -672,7 +672,7 @@ private: bool enableTilt = false; public: - GestureState(my_context ctx):my_base(ctx) + explicit GestureState(my_context ctx):my_base(ctx) { auto &ns = this->outermost_context().ns; ns.setViewingMode(NavigationStyle::PANNING); @@ -753,7 +753,7 @@ public: typedef sc::custom_reaction reactions; public: - AwaitingReleaseState(my_context ctx):my_base(ctx) + explicit AwaitingReleaseState(my_context ctx):my_base(ctx) { auto &ns = this->outermost_context().ns; if (ns.logging) @@ -803,7 +803,7 @@ public: typedef sc::custom_reaction reactions; public: - InteractState(my_context ctx):my_base(ctx) + explicit InteractState(my_context ctx):my_base(ctx) { auto &ns = this->outermost_context().ns; ns.setViewingMode(NavigationStyle::INTERACT); diff --git a/src/Gui/GraphvizView.cpp b/src/Gui/GraphvizView.cpp index 92793bace0..510f2cb65f 100644 --- a/src/Gui/GraphvizView.cpp +++ b/src/Gui/GraphvizView.cpp @@ -64,7 +64,7 @@ namespace Gui { class GraphvizWorker : public QThread { Q_OBJECT public: - GraphvizWorker(QObject * parent = nullptr) + explicit GraphvizWorker(QObject * parent = nullptr) : QThread(parent) { } diff --git a/src/Gui/GraphvizView.h b/src/Gui/GraphvizView.h index b49245b2a4..cff5d9c171 100644 --- a/src/Gui/GraphvizView.h +++ b/src/Gui/GraphvizView.h @@ -42,7 +42,7 @@ class GuiExport GraphvizView : public MDIView Q_OBJECT public: - GraphvizView(App::Document &_doc, QWidget* parent=nullptr); + explicit GraphvizView(App::Document &_doc, QWidget* parent=nullptr); ~GraphvizView() override; QByteArray exportGraph(const QString& filter); diff --git a/src/Gui/GuiApplication.cpp b/src/Gui/GuiApplication.cpp index a39f5d2ab3..6c607d5528 100644 --- a/src/Gui/GuiApplication.cpp +++ b/src/Gui/GuiApplication.cpp @@ -165,7 +165,7 @@ bool GUIApplication::event(QEvent * ev) class GUISingleApplication::Private { public: - Private(GUISingleApplication *q_ptr) + explicit Private(GUISingleApplication *q_ptr) : q_ptr(q_ptr) , timer(new QTimer(q_ptr)) , server(nullptr) diff --git a/src/Gui/GuiApplication.h b/src/Gui/GuiApplication.h index 7d6934e9cf..4dc32685e8 100644 --- a/src/Gui/GuiApplication.h +++ b/src/Gui/GuiApplication.h @@ -88,7 +88,7 @@ class WheelEventFilter : public QObject Q_OBJECT public: - WheelEventFilter(QObject* parent); + explicit WheelEventFilter(QObject* parent); bool eventFilter(QObject* obj, QEvent* ev) override; }; @@ -97,7 +97,7 @@ class KeyboardFilter : public QObject Q_OBJECT public: - KeyboardFilter(QObject* parent); + explicit KeyboardFilter(QObject* parent); bool eventFilter(QObject* obj, QEvent* ev) override; }; diff --git a/src/Gui/InputField.cpp b/src/Gui/InputField.cpp index a5d6077d61..19fbba42e1 100644 --- a/src/Gui/InputField.cpp +++ b/src/Gui/InputField.cpp @@ -52,7 +52,7 @@ namespace Gui { class InputValidator : public QValidator { public: - InputValidator(InputField* parent); + explicit InputValidator(InputField* parent); ~InputValidator() override; void fixup(QString& input) const override; diff --git a/src/Gui/MDIViewPy.h b/src/Gui/MDIViewPy.h index c47dbd4aa4..824423f199 100644 --- a/src/Gui/MDIViewPy.h +++ b/src/Gui/MDIViewPy.h @@ -41,7 +41,7 @@ public: static Py::Object type(); static Py::ExtensionObject create(MDIView *mdi); - MDIViewPy(MDIView *mdi); + explicit MDIViewPy(MDIView *mdi); ~MDIViewPy() override; Py::Object repr() override; diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index aab8fe3fe1..a309cfe883 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -165,7 +165,7 @@ struct MainWindowP class MDITabbar : public QTabBar { public: - MDITabbar( QWidget * parent = nullptr ) : QTabBar(parent) + explicit MDITabbar( QWidget * parent = nullptr ) : QTabBar(parent) { menu = new QMenu(this); setDrawBase(false); diff --git a/src/Gui/MainWindow.h b/src/Gui/MainWindow.h index 5ef71b4152..d0a9f7e5f5 100644 --- a/src/Gui/MainWindow.h +++ b/src/Gui/MainWindow.h @@ -55,7 +55,7 @@ class GuiExport UrlHandler : public QObject Q_OBJECT public: - UrlHandler(QObject* parent = nullptr) + explicit UrlHandler(QObject* parent = nullptr) : QObject(parent){ } ~UrlHandler() override { @@ -85,7 +85,7 @@ public: * Constructs an empty main window. For default \a parent is 0, as there usually is * no toplevel window there. */ - MainWindow(QWidget * parent = nullptr, Qt::WindowFlags f = Qt::Window); + explicit MainWindow(QWidget * parent = nullptr, Qt::WindowFlags f = Qt::Window); /** Destroys the object and frees any allocated resources. */ ~MainWindow() override; /** @@ -375,7 +375,7 @@ public: static int EventType; enum Style {Restore, Clear}; - ActionStyleEvent(Style type); + explicit ActionStyleEvent(Style type); Style getType() const; private: diff --git a/src/Gui/MainWindowPy.h b/src/Gui/MainWindowPy.h index 292eb2f0be..36eded65ee 100644 --- a/src/Gui/MainWindowPy.h +++ b/src/Gui/MainWindowPy.h @@ -42,7 +42,7 @@ public: static Py::Object type(); static Py::ExtensionObject create(MainWindow *mw); - MainWindowPy(MainWindow *mw); + explicit MainWindowPy(MainWindow *mw); ~MainWindowPy() override; Py::Object repr() override; diff --git a/src/Gui/MenuManager.h b/src/Gui/MenuManager.h index dfdcbd3740..416838a497 100644 --- a/src/Gui/MenuManager.h +++ b/src/Gui/MenuManager.h @@ -38,7 +38,7 @@ class GuiExport MenuItem { public: MenuItem(); - MenuItem(MenuItem*); + explicit MenuItem(MenuItem*); ~MenuItem(); void setCommand(const std::string&); diff --git a/src/Gui/MergeDocuments.h b/src/Gui/MergeDocuments.h index f4d08f363d..92612e7532 100644 --- a/src/Gui/MergeDocuments.h +++ b/src/Gui/MergeDocuments.h @@ -39,7 +39,7 @@ class Document; class GuiExport MergeDocuments : public Base::Persistence { public: - MergeDocuments(App::Document* doc); + explicit MergeDocuments(App::Document* doc); ~MergeDocuments() override; unsigned int getMemSize () const override; std::vector importObjects(std::istream&); diff --git a/src/Gui/NaviCube.cpp b/src/Gui/NaviCube.cpp index d5dafc90e6..0362baee15 100644 --- a/src/Gui/NaviCube.cpp +++ b/src/Gui/NaviCube.cpp @@ -112,7 +112,7 @@ public: class NaviCubeImplementation : public ParameterGrp::ObserverType { public: - NaviCubeImplementation(Gui::View3DInventorViewer*); + explicit NaviCubeImplementation(Gui::View3DInventorViewer*); ~NaviCubeImplementation() override; void drawNaviCube(); void createContextMenu(const std::vector& cmd); diff --git a/src/Gui/NavigationStyle.h b/src/Gui/NavigationStyle.h index 862acb397f..a621cc1466 100644 --- a/src/Gui/NavigationStyle.h +++ b/src/Gui/NavigationStyle.h @@ -60,7 +60,7 @@ class AbstractMouseSelection; class GuiExport NavigationStyleEvent : public QEvent { public: - NavigationStyleEvent(const Base::Type& s); + explicit NavigationStyleEvent(const Base::Type& s); ~NavigationStyleEvent() override; const Base::Type& style() const; private: diff --git a/src/Gui/OnlineDocumentation.h b/src/Gui/OnlineDocumentation.h index 5a345ada84..d55b386494 100644 --- a/src/Gui/OnlineDocumentation.h +++ b/src/Gui/OnlineDocumentation.h @@ -60,7 +60,7 @@ class HttpServer : public QTcpServer Q_OBJECT public: - HttpServer(QObject* parent = nullptr); + explicit HttpServer(QObject* parent = nullptr); void incomingConnection(qintptr socket) override; void pause(); diff --git a/src/Gui/Placement.cpp b/src/Gui/Placement.cpp index 11eca6d970..0e3fb59865 100644 --- a/src/Gui/Placement.cpp +++ b/src/Gui/Placement.cpp @@ -53,7 +53,7 @@ namespace Gui { namespace Dialog { class find_placement { public: - find_placement(const std::string& name) : propertyname(name) + explicit find_placement(const std::string& name) : propertyname(name) { } bool operator () (const std::pair& elem) const diff --git a/src/Gui/Placement.h b/src/Gui/Placement.h index b02a04fef0..50ffabf595 100644 --- a/src/Gui/Placement.h +++ b/src/Gui/Placement.h @@ -43,7 +43,7 @@ class GuiExport Placement : public Gui::LocationDialog Q_OBJECT public: - Placement(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); + explicit Placement(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); ~Placement() override; void accept() override; void reject() override; @@ -114,7 +114,7 @@ class GuiExport DockablePlacement : public Placement Q_OBJECT public: - DockablePlacement(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); + explicit DockablePlacement(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); ~DockablePlacement() override; void accept() override; diff --git a/src/Gui/PrefWidgets.h b/src/Gui/PrefWidgets.h index 0501c13b6d..35c473f5bc 100644 --- a/src/Gui/PrefWidgets.h +++ b/src/Gui/PrefWidgets.h @@ -117,7 +117,7 @@ class GuiExport PrefSpinBox : public QSpinBox, public PrefWidget Q_PROPERTY( QByteArray prefPath READ paramGrpPath WRITE setParamGrpPath ) // clazy:exclude=qproperty-without-notify public: - PrefSpinBox ( QWidget * parent = nullptr ); + explicit PrefSpinBox ( QWidget * parent = nullptr ); ~PrefSpinBox() override; protected: @@ -137,7 +137,7 @@ class GuiExport PrefDoubleSpinBox : public QDoubleSpinBox, public PrefWidget Q_PROPERTY( QByteArray prefPath READ paramGrpPath WRITE setParamGrpPath ) // clazy:exclude=qproperty-without-notify public: - PrefDoubleSpinBox ( QWidget * parent = nullptr ); + explicit PrefDoubleSpinBox ( QWidget * parent = nullptr ); ~PrefDoubleSpinBox() override; protected: @@ -158,7 +158,7 @@ class GuiExport PrefLineEdit : public QLineEdit, public PrefWidget Q_PROPERTY( QByteArray prefPath READ paramGrpPath WRITE setParamGrpPath ) // clazy:exclude=qproperty-without-notify public: - PrefLineEdit ( QWidget * parent = nullptr ); + explicit PrefLineEdit ( QWidget * parent = nullptr ); ~PrefLineEdit() override; protected: @@ -179,7 +179,7 @@ class GuiExport PrefTextEdit : public QTextEdit, public PrefWidget Q_PROPERTY(QByteArray prefPath READ paramGrpPath WRITE setParamGrpPath) // clazy:exclude=qproperty-without-notify public: - PrefTextEdit(QWidget* parent = nullptr); + explicit PrefTextEdit(QWidget* parent = nullptr); ~PrefTextEdit() override; protected: @@ -200,7 +200,7 @@ class GuiExport PrefFileChooser : public FileChooser, public PrefWidget Q_PROPERTY( QByteArray prefPath READ paramGrpPath WRITE setParamGrpPath ) // clazy:exclude=qproperty-without-notify public: - PrefFileChooser ( QWidget * parent = nullptr ); + explicit PrefFileChooser ( QWidget * parent = nullptr ); ~PrefFileChooser() override; protected: @@ -221,7 +221,7 @@ class GuiExport PrefComboBox : public QComboBox, public PrefWidget Q_PROPERTY( QByteArray prefPath READ paramGrpPath WRITE setParamGrpPath ) // clazy:exclude=qproperty-without-notify public: - PrefComboBox ( QWidget * parent = nullptr ); + explicit PrefComboBox ( QWidget * parent = nullptr ); ~PrefComboBox() override; protected: @@ -242,7 +242,7 @@ class GuiExport PrefCheckBox : public QCheckBox, public PrefWidget Q_PROPERTY( QByteArray prefPath READ paramGrpPath WRITE setParamGrpPath ) // clazy:exclude=qproperty-without-notify public: - PrefCheckBox ( QWidget * parent = nullptr ); + explicit PrefCheckBox ( QWidget * parent = nullptr ); ~PrefCheckBox() override; protected: @@ -263,7 +263,7 @@ class GuiExport PrefRadioButton : public QRadioButton, public PrefWidget Q_PROPERTY( QByteArray prefPath READ paramGrpPath WRITE setParamGrpPath ) // clazy:exclude=qproperty-without-notify public: - PrefRadioButton ( QWidget * parent = nullptr ); + explicit PrefRadioButton ( QWidget * parent = nullptr ); ~PrefRadioButton() override; protected: @@ -284,7 +284,7 @@ class GuiExport PrefSlider : public QSlider, public PrefWidget Q_PROPERTY( QByteArray prefPath READ paramGrpPath WRITE setParamGrpPath ) // clazy:exclude=qproperty-without-notify public: - PrefSlider ( QWidget * parent = nullptr ); + explicit PrefSlider ( QWidget * parent = nullptr ); ~PrefSlider() override; protected: @@ -305,7 +305,7 @@ class GuiExport PrefColorButton : public ColorButton, public PrefWidget Q_PROPERTY( QByteArray prefPath READ paramGrpPath WRITE setParamGrpPath ) // clazy:exclude=qproperty-without-notify public: - PrefColorButton ( QWidget * parent = nullptr ); + explicit PrefColorButton ( QWidget * parent = nullptr ); ~PrefColorButton() override; protected: @@ -327,7 +327,7 @@ class GuiExport PrefUnitSpinBox : public QuantitySpinBox, public PrefWidget Q_PROPERTY( QByteArray prefPath READ paramGrpPath WRITE setParamGrpPath ) // clazy:exclude=qproperty-without-notify public: - PrefUnitSpinBox ( QWidget * parent = nullptr ); + explicit PrefUnitSpinBox ( QWidget * parent = nullptr ); ~PrefUnitSpinBox() override; protected: @@ -351,7 +351,7 @@ class GuiExport PrefQuantitySpinBox : public QuantitySpinBox, public PrefWidget Q_PROPERTY(int historySize READ historySize WRITE setHistorySize) // clazy:exclude=qproperty-without-notify public: - PrefQuantitySpinBox (QWidget * parent = nullptr); + explicit PrefQuantitySpinBox (QWidget * parent = nullptr); ~PrefQuantitySpinBox() override; /// set the input field to the last used value (works only if the setParamGrpPath() was called) @@ -392,7 +392,7 @@ class GuiExport PrefFontBox : public QFontComboBox, public PrefWidget Q_PROPERTY( QByteArray prefPath READ paramGrpPath WRITE setParamGrpPath ) // clazy:exclude=qproperty-without-notify public: - PrefFontBox ( QWidget * parent = nullptr ); + explicit PrefFontBox ( QWidget * parent = nullptr ); ~PrefFontBox() override; protected: diff --git a/src/Gui/ProgressDialog.h b/src/Gui/ProgressDialog.h index ea20713320..f86376fd1f 100644 --- a/src/Gui/ProgressDialog.h +++ b/src/Gui/ProgressDialog.h @@ -83,7 +83,7 @@ class ProgressDialog : public QProgressDialog public: /** Construction */ - ProgressDialog (SequencerDialog* s, QWidget * parent=nullptr); + explicit ProgressDialog (SequencerDialog* s, QWidget * parent=nullptr); /** Destruction */ ~ProgressDialog () override; diff --git a/src/Gui/ProjectView.h b/src/Gui/ProjectView.h index 47689aefda..f41a5f1dca 100644 --- a/src/Gui/ProjectView.h +++ b/src/Gui/ProjectView.h @@ -39,7 +39,7 @@ class ProjectWidget : public QTreeView Q_OBJECT public: - ProjectWidget(QWidget* parent=nullptr); + explicit ProjectWidget(QWidget* parent=nullptr); ~ProjectWidget() override; private: diff --git a/src/Gui/PropertyPage.h b/src/Gui/PropertyPage.h index 1df92e192b..4a67b21e36 100644 --- a/src/Gui/PropertyPage.h +++ b/src/Gui/PropertyPage.h @@ -38,7 +38,7 @@ class GuiExport PropertyPage : public QWidget Q_OBJECT public: - PropertyPage(QWidget* parent = nullptr); + explicit PropertyPage(QWidget* parent = nullptr); ~PropertyPage() override; bool isModified(); @@ -68,7 +68,7 @@ class GuiExport PreferencePage : public QWidget Q_OBJECT public: - PreferencePage(QWidget* parent = nullptr); + explicit PreferencePage(QWidget* parent = nullptr); ~PreferencePage() override; public Q_SLOTS: @@ -87,7 +87,7 @@ class GuiExport PreferenceUiForm : public PreferencePage Q_OBJECT public: - PreferenceUiForm(const QString& fn, QWidget* parent = nullptr); + explicit PreferenceUiForm(const QString& fn, QWidget* parent = nullptr); ~PreferenceUiForm() override; void loadSettings() override; @@ -114,7 +114,7 @@ class GuiExport CustomizeActionPage : public QWidget Q_OBJECT public: - CustomizeActionPage(QWidget* parent = nullptr); + explicit CustomizeActionPage(QWidget* parent = nullptr); ~CustomizeActionPage() override; protected: diff --git a/src/Gui/PropertyView.cpp b/src/Gui/PropertyView.cpp index 0106505e4a..196a58ff13 100644 --- a/src/Gui/PropertyView.cpp +++ b/src/Gui/PropertyView.cpp @@ -311,7 +311,7 @@ struct PropertyView::PropInfo struct PropertyView::PropFind { const PropInfo& item; - PropFind(const PropInfo& item) : item(item) {} + explicit PropFind(const PropInfo& item) : item(item) {} bool operator () (const PropInfo& elem) const { return (elem.propId == item.propId) && diff --git a/src/Gui/PropertyView.h b/src/Gui/PropertyView.h index 39e99dde1c..9e400fba0e 100644 --- a/src/Gui/PropertyView.h +++ b/src/Gui/PropertyView.h @@ -56,7 +56,7 @@ class PropertyView : public QWidget, public Gui::SelectionObserver Q_OBJECT public: - PropertyView(QWidget *parent=nullptr); + explicit PropertyView(QWidget *parent=nullptr); ~PropertyView() override; Gui::PropertyEditor::PropertyEditor* propertyEditorView; @@ -120,7 +120,7 @@ class PropertyDockView : public Gui::DockWindow Q_OBJECT public: - PropertyDockView(Gui::Document* pcDocument, QWidget *parent=nullptr); + explicit PropertyDockView(Gui::Document* pcDocument, QWidget *parent=nullptr); ~PropertyDockView() override; }; diff --git a/src/Gui/PythonConsole.h b/src/Gui/PythonConsole.h index e0980b39a0..1db269840e 100644 --- a/src/Gui/PythonConsole.h +++ b/src/Gui/PythonConsole.h @@ -105,7 +105,7 @@ public: Special = 3 }; - PythonConsole(QWidget *parent = nullptr); + explicit PythonConsole(QWidget *parent = nullptr); ~PythonConsole() override; void OnChange( Base::Subject &rCaller,const char* rcReason ) override; @@ -174,7 +174,7 @@ private: class GuiExport PythonConsoleHighlighter : public PythonSyntaxHighlighter { public: - PythonConsoleHighlighter(QObject* parent); + explicit PythonConsoleHighlighter(QObject* parent); ~PythonConsoleHighlighter() override; void highlightBlock (const QString & text) override; diff --git a/src/Gui/PythonConsolePy.h b/src/Gui/PythonConsolePy.h index 3cc94afed6..1b1c290b02 100644 --- a/src/Gui/PythonConsolePy.h +++ b/src/Gui/PythonConsolePy.h @@ -47,7 +47,7 @@ private: public: static void init_type(); // announce properties and methods - PythonStdout(PythonConsole *pc); + explicit PythonStdout(PythonConsole *pc); ~PythonStdout() override; Py::Object getattr(const char *name) override; @@ -73,7 +73,7 @@ private: public: static void init_type(); // announce properties and methods - PythonStderr(PythonConsole *pc); + explicit PythonStderr(PythonConsole *pc); ~PythonStderr() override; Py::Object getattr(const char *name) override; @@ -141,7 +141,7 @@ private: public: static void init_type(); // announce properties and methods - PythonStdin(PythonConsole *pc); + explicit PythonStdin(PythonConsole *pc); ~PythonStdin() override; Py::Object repr() override; diff --git a/src/Gui/PythonEditor.h b/src/Gui/PythonEditor.h index f0e5e21d5c..7ddc5aa628 100644 --- a/src/Gui/PythonEditor.h +++ b/src/Gui/PythonEditor.h @@ -41,7 +41,7 @@ class GuiExport PythonEditor : public TextEditor Q_OBJECT public: - PythonEditor(QWidget *parent = nullptr); + explicit PythonEditor(QWidget *parent = nullptr); ~PythonEditor() override; void toggleBreakpoint(); @@ -79,7 +79,7 @@ private: class GuiExport PythonSyntaxHighlighter : public SyntaxHighlighter { public: - PythonSyntaxHighlighter(QObject* parent); + explicit PythonSyntaxHighlighter(QObject* parent); virtual ~PythonSyntaxHighlighter(); void highlightBlock (const QString & text); diff --git a/src/Gui/ReportView.h b/src/Gui/ReportView.h index 9700f98a9b..ff6989fe3c 100644 --- a/src/Gui/ReportView.h +++ b/src/Gui/ReportView.h @@ -51,7 +51,7 @@ class ReportView : public QWidget Q_OBJECT public: - ReportView( QWidget* parent = nullptr); + explicit ReportView( QWidget* parent = nullptr); ~ReportView() override; protected: @@ -77,7 +77,7 @@ public: }; public: - ReportHighlighter(QTextEdit* ); + explicit ReportHighlighter(QTextEdit* ); ~ReportHighlighter() override; /** Parses the given text and highlight it in the right colors. */ @@ -128,7 +128,7 @@ class GuiExport ReportOutput : public QTextEdit, public WindowParameter, public Q_OBJECT public: - ReportOutput(QWidget* parent=nullptr); + explicit ReportOutput(QWidget* parent=nullptr); ~ReportOutput() override; /** Observes its parameter group. */ @@ -207,7 +207,7 @@ class ReportOutputObserver : public QObject Q_OBJECT public: - ReportOutputObserver (ReportOutput* view); + explicit ReportOutputObserver (ReportOutput* view); bool eventFilter(QObject *obj, QEvent *event) override; protected: diff --git a/src/Gui/Selection.h b/src/Gui/Selection.h index 8d03b443d0..0c2abdef16 100644 --- a/src/Gui/Selection.h +++ b/src/Gui/Selection.h @@ -105,7 +105,7 @@ public: if (typeName) TypeName = typeName; pTypeName = TypeName.c_str(); - } + }//explicit bombs SelectionChanges(MsgType type, const std::string &docName, @@ -230,7 +230,7 @@ public: * 1 resolve sub-object with old style element name * 2 resolve sub-object with new style element name */ - SelectionObserver(bool attach = true, ResolveMode resolve = ResolveMode::OldStyleElement); + explicit SelectionObserver(bool attach = true, ResolveMode resolve = ResolveMode::OldStyleElement); /** Constructor * * @param vp: filtering view object. @@ -243,7 +243,7 @@ public: * Constructs an selection observer that receives only selection event of * objects within the same document as the input view object. */ - SelectionObserver(const Gui::ViewProviderDocumentObject *vp, bool attach=true, ResolveMode resolve = ResolveMode::OldStyleElement); + explicit SelectionObserver(const Gui::ViewProviderDocumentObject *vp, bool attach=true, ResolveMode resolve = ResolveMode::OldStyleElement); virtual ~SelectionObserver(); bool blockSelection(bool block); @@ -280,7 +280,7 @@ class GuiExport SelectionObserverPython : public SelectionObserver public: /// Constructor - SelectionObserverPython(const Py::Object& obj, ResolveMode resolve = ResolveMode::OldStyleElement); + explicit SelectionObserverPython(const Py::Object& obj, ResolveMode resolve = ResolveMode::OldStyleElement); ~SelectionObserverPython() override; static void addObserver(const Py::Object& obj, ResolveMode resolve = ResolveMode::OldStyleElement); @@ -342,7 +342,7 @@ public: class GuiExport SelectionGateFilterExternal: public SelectionGate { public: - SelectionGateFilterExternal(const char *docName, const char *objName=nullptr); + explicit SelectionGateFilterExternal(const char *docName, const char *objName=nullptr); bool allow(App::Document*,App::DocumentObject*, const char*) override; private: std::string DocName; @@ -771,7 +771,7 @@ inline SelectionSingleton& Selection() */ class GuiExport SelectionLogDisabler { public: - SelectionLogDisabler(bool silent=false) :silent(silent) { + explicit SelectionLogDisabler(bool silent=false) :silent(silent) { Selection().disableCommandLog(); } ~SelectionLogDisabler() { diff --git a/src/Gui/SelectionFilter.h b/src/Gui/SelectionFilter.h index 9892979e37..69b5208f27 100644 --- a/src/Gui/SelectionFilter.h +++ b/src/Gui/SelectionFilter.h @@ -52,8 +52,8 @@ class GuiExport SelectionFilter public: /** Constructs a SelectionFilter object. */ - SelectionFilter(const char* filter); - SelectionFilter(const std::string& filter); + explicit SelectionFilter(const char* filter); + explicit SelectionFilter(const std::string& filter); virtual ~SelectionFilter(); /// Set a new filter string @@ -103,8 +103,8 @@ class GuiExport SelectionFilterGate: public SelectionGate { public: /// construct with the filter string - SelectionFilterGate(const char* filter); - SelectionFilterGate(SelectionFilter* filter); + explicit SelectionFilterGate(const char* filter); + explicit SelectionFilterGate(SelectionFilter* filter); ~SelectionFilterGate() override; bool allow(App::Document*,App::DocumentObject*, const char*) override; @@ -130,7 +130,7 @@ class SelectionGatePython : public SelectionGate { public: /// Constructor - SelectionGatePython(const Py::Object& obj); + explicit SelectionGatePython(const Py::Object& obj); ~SelectionGatePython() override; bool allow(App::Document*, App::DocumentObject*, const char*) override; @@ -156,7 +156,7 @@ public: public: static void init_type(); // announce properties and methods - SelectionFilterPy(const std::string&); + explicit SelectionFilterPy(const std::string&); ~SelectionFilterPy() override; Py::Object repr() override; @@ -189,7 +189,7 @@ class SelectionFilterGatePython : public SelectionGate { public: /// Constructor - SelectionFilterGatePython(SelectionFilterPy* obj); + explicit SelectionFilterGatePython(SelectionFilterPy* obj); ~SelectionFilterGatePython() override; bool allow(App::Document*, App::DocumentObject*, const char*) override; @@ -202,7 +202,7 @@ private: struct Node_Slice { - Node_Slice(int min=1,int max=INT_MAX):Min(min),Max(max){} + explicit Node_Slice(int min=1,int max=INT_MAX):Min(min),Max(max){} int Min,Max; }; @@ -229,7 +229,7 @@ typedef std::shared_ptr Node_ObjectPtr; struct Node_Block { - Node_Block(Node_Object* obj){ + explicit Node_Block(Node_Object* obj){ Objects.emplace_back(obj); } std::vector Objects; diff --git a/src/Gui/SelectionObject.h b/src/Gui/SelectionObject.h index 5e64004dc1..44e8e3b6bb 100644 --- a/src/Gui/SelectionObject.h +++ b/src/Gui/SelectionObject.h @@ -49,7 +49,7 @@ public: SelectionObject(); /*! Constructs a SelectionObject from the SelectionChanges structure. */ - SelectionObject(const SelectionChanges& msg); + explicit SelectionObject(const SelectionChanges& msg); explicit SelectionObject(App::DocumentObject*); ~SelectionObject() override; /** diff --git a/src/Gui/SelectionView.h b/src/Gui/SelectionView.h index 3341332590..318d67d6bc 100644 --- a/src/Gui/SelectionView.h +++ b/src/Gui/SelectionView.h @@ -51,7 +51,7 @@ public: * A constructor. * A more elaborate description of the constructor. */ - SelectionView(Gui::Document* pcDocument, QWidget *parent=nullptr); + explicit SelectionView(Gui::Document* pcDocument, QWidget *parent=nullptr); /** * A destructor. diff --git a/src/Gui/SoFCOffscreenRenderer.h b/src/Gui/SoFCOffscreenRenderer.h index c8df7c2af2..f8c0ff99f1 100644 --- a/src/Gui/SoFCOffscreenRenderer.h +++ b/src/Gui/SoFCOffscreenRenderer.h @@ -153,7 +153,7 @@ class SoQtOffscreenRendererPy : public Py::PythonExtensionpubl = p; } diff --git a/src/Gui/SoTouchEvents.h b/src/Gui/SoTouchEvents.h index 5e2c915a44..809e167628 100644 --- a/src/Gui/SoTouchEvents.h +++ b/src/Gui/SoTouchEvents.h @@ -115,7 +115,7 @@ public: class GesturesDevice : public Quarter::InputDevice { public: - GesturesDevice(QWidget* widget);//it needs to know the widget to do coordinate translation + explicit GesturesDevice(QWidget* widget);//it needs to know the widget to do coordinate translation ~GesturesDevice() override {} const SoEvent* translateEvent(QEvent* event) override; diff --git a/src/Gui/SpaceballEvent.h b/src/Gui/SpaceballEvent.h index 8c10ebf681..ea56fc6d23 100644 --- a/src/Gui/SpaceballEvent.h +++ b/src/Gui/SpaceballEvent.h @@ -36,7 +36,7 @@ namespace Spaceball void setHandled(bool sig){handled = sig;} protected: - EventBase(QEvent::Type event); + explicit EventBase(QEvent::Type event); bool handled; }; diff --git a/src/Gui/SpinBox.h b/src/Gui/SpinBox.h index caa91c6931..a81d0a454c 100644 --- a/src/Gui/SpinBox.h +++ b/src/Gui/SpinBox.h @@ -39,7 +39,7 @@ namespace Gui { class GuiExport ExpressionSpinBox : public ExpressionBinding { public: - ExpressionSpinBox(QAbstractSpinBox*); + explicit ExpressionSpinBox(QAbstractSpinBox*); ~ExpressionSpinBox() override; void bind(const App::ObjectIdentifier &_path) override; @@ -83,7 +83,7 @@ class GuiExport UnsignedValidator : public QValidator Q_PROPERTY( uint top READ top WRITE setTop ) // clazy:exclude=qproperty-without-notify public: - UnsignedValidator( QObject * parent ); + explicit UnsignedValidator( QObject * parent ); UnsignedValidator( uint bottom, uint top, QObject * parent ); ~UnsignedValidator() override; @@ -115,7 +115,7 @@ class GuiExport UIntSpinBox : public QSpinBox, public ExpressionSpinBox Q_OVERRIDE( uint value READ value WRITE setValue ) public: - UIntSpinBox ( QWidget* parent=nullptr ); + explicit UIntSpinBox ( QWidget* parent=nullptr ); ~UIntSpinBox() override; void setRange( uint minVal, uint maxVal ); @@ -162,7 +162,7 @@ class GuiExport IntSpinBox : public QSpinBox, public ExpressionSpinBox Q_OBJECT public: - IntSpinBox ( QWidget* parent=nullptr ); + explicit IntSpinBox ( QWidget* parent=nullptr ); ~IntSpinBox() override; bool apply(const std::string &propName) override; @@ -184,7 +184,7 @@ class GuiExport DoubleSpinBox : public QDoubleSpinBox, public ExpressionSpinBox Q_OBJECT public: - DoubleSpinBox ( QWidget* parent=nullptr ); + explicit DoubleSpinBox ( QWidget* parent=nullptr ); ~DoubleSpinBox() override; bool apply(const std::string &propName) override; diff --git a/src/Gui/Splashscreen.h b/src/Gui/Splashscreen.h index 558bfd11f7..a0368184f5 100644 --- a/src/Gui/Splashscreen.h +++ b/src/Gui/Splashscreen.h @@ -41,7 +41,7 @@ class SplashScreen : public QSplashScreen Q_OBJECT public: - SplashScreen( const QPixmap & pixmap = QPixmap ( ), Qt::WindowFlags f = Qt::WindowFlags() ); + explicit SplashScreen( const QPixmap & pixmap = QPixmap ( ), Qt::WindowFlags f = Qt::WindowFlags() ); ~SplashScreen() override; protected: @@ -74,7 +74,7 @@ class GuiExport LicenseView : public Gui::MDIView Q_OBJECT public: - LicenseView(QWidget* parent=nullptr); + explicit LicenseView(QWidget* parent=nullptr); ~LicenseView() override; void setSource(const QUrl & url); @@ -95,7 +95,7 @@ class GuiExport AboutDialog : public QDialog Q_OBJECT public: - AboutDialog(bool showLic, QWidget* parent = nullptr); + explicit AboutDialog(bool showLic, QWidget* parent = nullptr); ~AboutDialog() override; protected: diff --git a/src/Gui/TaskDlgRelocation.h b/src/Gui/TaskDlgRelocation.h index 70cee3bc4f..d26d043b8f 100644 --- a/src/Gui/TaskDlgRelocation.h +++ b/src/Gui/TaskDlgRelocation.h @@ -38,7 +38,7 @@ class TaskBoxPosition : public Gui::TaskView::TaskBox Q_OBJECT public: - TaskBoxPosition(QWidget *parent = nullptr); + explicit TaskBoxPosition(QWidget *parent = nullptr); ~TaskBoxPosition() override; @@ -56,7 +56,7 @@ class TaskBoxAngle : public Gui::TaskView::TaskBox Q_OBJECT public: - TaskBoxAngle(QWidget *parent = nullptr); + explicit TaskBoxAngle(QWidget *parent = nullptr); ~TaskBoxAngle() override; diff --git a/src/Gui/TaskElementColors.cpp b/src/Gui/TaskElementColors.cpp index 5ca57f09ff..1bdfea3a36 100644 --- a/src/Gui/TaskElementColors.cpp +++ b/src/Gui/TaskElementColors.cpp @@ -72,7 +72,7 @@ public: std::string editSub; std::string editElement; - Private(ViewProviderDocumentObject* vp, const char *element="") + explicit Private(ViewProviderDocumentObject* vp, const char *element="") : ui(new Ui_TaskElementColors()), vp(vp),editElement(element) { vpDoc = vp->getDocument(); diff --git a/src/Gui/TaskElementColors.h b/src/Gui/TaskElementColors.h index 6e6aa838ee..75cefc93ff 100644 --- a/src/Gui/TaskElementColors.h +++ b/src/Gui/TaskElementColors.h @@ -38,7 +38,7 @@ class GuiExport ElementColors : public QWidget, public SelectionObserver Q_OBJECT public: - ElementColors(ViewProviderDocumentObject* vp, bool noHide=false); + explicit ElementColors(ViewProviderDocumentObject* vp, bool noHide=false); ~ElementColors() override; bool accept(); @@ -72,7 +72,7 @@ class GuiExport TaskElementColors : public TaskView::TaskDialog Q_OBJECT public: - TaskElementColors(ViewProviderDocumentObject* vp, bool noHide=false); + explicit TaskElementColors(ViewProviderDocumentObject* vp, bool noHide=false); ~TaskElementColors() override; public: diff --git a/src/Gui/TaskView/TaskAppearance.h b/src/Gui/TaskView/TaskAppearance.h index b8edba0ccd..81e6fdd634 100644 --- a/src/Gui/TaskView/TaskAppearance.h +++ b/src/Gui/TaskView/TaskAppearance.h @@ -45,7 +45,7 @@ class TaskAppearance : public TaskBox, public Gui::SelectionSingleton::ObserverT Q_OBJECT public: - TaskAppearance(QWidget *parent = nullptr); + explicit TaskAppearance(QWidget *parent = nullptr); ~TaskAppearance() override; /// Observer message from the Selection void OnChange(Gui::SelectionSingleton::SubjectType &rCaller, diff --git a/src/Gui/TaskView/TaskDialogPython.h b/src/Gui/TaskView/TaskDialogPython.h index ff2b0eff1e..fb08258fe2 100644 --- a/src/Gui/TaskView/TaskDialogPython.h +++ b/src/Gui/TaskView/TaskDialogPython.h @@ -59,7 +59,7 @@ private: class GuiExport TaskWatcherPython : public TaskWatcher { public: - TaskWatcherPython(const Py::Object&); + explicit TaskWatcherPython(const Py::Object&); ~TaskWatcherPython() override; bool shouldShow() override; @@ -70,7 +70,7 @@ private: class GuiExport TaskDialogPython : public TaskDialog { public: - TaskDialogPython(const Py::Object&); + explicit TaskDialogPython(const Py::Object&); ~TaskDialogPython() override; QDialogButtonBox::StandardButtons getStandardButtons() const override; diff --git a/src/Gui/TaskView/TaskEditControl.h b/src/Gui/TaskView/TaskEditControl.h index fd0a8e58f1..2f51cb53ec 100644 --- a/src/Gui/TaskView/TaskEditControl.h +++ b/src/Gui/TaskView/TaskEditControl.h @@ -46,7 +46,7 @@ class TaskEditControl : public TaskWidget Q_OBJECT public: - TaskEditControl(QWidget *parent = nullptr); + explicit TaskEditControl(QWidget *parent = nullptr); ~TaskEditControl() override; QDialogButtonBox* standardButtons() const; friend class TaskView; diff --git a/src/Gui/TaskView/TaskView.h b/src/Gui/TaskView/TaskView.h index d73f676944..c30ba52e9c 100644 --- a/src/Gui/TaskView/TaskView.h +++ b/src/Gui/TaskView/TaskView.h @@ -128,7 +128,7 @@ class GuiExport TaskWidget : public QWidget, public TaskContent Q_OBJECT public: - TaskWidget(QWidget *parent=nullptr); + explicit TaskWidget(QWidget *parent=nullptr); ~TaskWidget() override; }; @@ -142,7 +142,7 @@ class GuiExport TaskView : public QScrollArea, public Gui::SelectionSingleton::O Q_OBJECT public: - TaskView(QWidget *parent = nullptr); + explicit TaskView(QWidget *parent = nullptr); ~TaskView() override; /// Observer message from the Selection diff --git a/src/Gui/TaskView/TaskWatcher.h b/src/Gui/TaskView/TaskWatcher.h index fe40d3795c..147fe71dba 100644 --- a/src/Gui/TaskView/TaskWatcher.h +++ b/src/Gui/TaskView/TaskWatcher.h @@ -41,7 +41,7 @@ class GuiExport TaskWatcher : public QObject, public Gui::SelectionFilter Q_OBJECT public: - TaskWatcher(const char* Filter); + explicit TaskWatcher(const char* Filter); ~TaskWatcher() override; std::vector &getWatcherContent(); diff --git a/src/Gui/TextEdit.h b/src/Gui/TextEdit.h index 055705409e..8e1f7d9fb0 100644 --- a/src/Gui/TextEdit.h +++ b/src/Gui/TextEdit.h @@ -57,7 +57,7 @@ class GuiExport TextEdit : public QPlainTextEdit Q_OBJECT public: - TextEdit(QWidget *parent = nullptr); + explicit TextEdit(QWidget *parent = nullptr); ~TextEdit() override; private Q_SLOTS: @@ -86,7 +86,7 @@ class GuiExport TextEditor : public TextEdit, public WindowParameter Q_OBJECT public: - TextEditor(QWidget *parent = nullptr); + explicit TextEditor(QWidget *parent = nullptr); ~TextEditor() override; void setSyntaxHighlighter(SyntaxHighlighter*); @@ -122,7 +122,7 @@ class LineMarker : public QWidget Q_OBJECT public: - LineMarker(TextEditor* editor); + explicit LineMarker(TextEditor* editor); ~LineMarker() override; QSize sizeHint() const override; @@ -145,7 +145,7 @@ class CompletionList : public QListWidget public: /// Construction - CompletionList(QPlainTextEdit* parent); + explicit CompletionList(QPlainTextEdit* parent); /// Destruction ~CompletionList() override; diff --git a/src/Gui/TextureMapping.h b/src/Gui/TextureMapping.h index b258b007d1..a3ec51ac9c 100644 --- a/src/Gui/TextureMapping.h +++ b/src/Gui/TextureMapping.h @@ -39,7 +39,7 @@ class GuiExport TextureMapping : public QDialog Q_OBJECT public: - TextureMapping(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); + explicit TextureMapping(QWidget* parent = nullptr, Qt::WindowFlags fl = Qt::WindowFlags()); ~TextureMapping(); void accept(); void reject(); diff --git a/src/Gui/Tree.cpp b/src/Gui/Tree.cpp index 9b27541535..f9e5eff402 100644 --- a/src/Gui/Tree.cpp +++ b/src/Gui/Tree.cpp @@ -203,7 +203,7 @@ struct TimingInfo { bool timed = false; FC_TIME_POINT t; FC_DURATION& d; - TimingInfo(FC_DURATION& d) + explicit TimingInfo(FC_DURATION& d) :d(d) { _FC_TIME_INIT(t); diff --git a/src/Gui/Tree.h b/src/Gui/Tree.h index 1a71a5f1ac..6b8fe56965 100644 --- a/src/Gui/Tree.h +++ b/src/Gui/Tree.h @@ -56,7 +56,7 @@ class TreeWidget : public QTreeWidget, public SelectionObserver Q_OBJECT public: - TreeWidget(const char *name, QWidget* parent=nullptr); + explicit TreeWidget(const char *name, QWidget* parent=nullptr); ~TreeWidget() override; static void scrollItemToTop(); @@ -446,7 +446,7 @@ class TreePanel : public QWidget Q_OBJECT public: - TreePanel(const char *name, QWidget* parent=nullptr); + explicit TreePanel(const char *name, QWidget* parent=nullptr); ~TreePanel() override; bool eventFilter(QObject *obj, QEvent *ev) override; @@ -471,7 +471,7 @@ class TreeDockWidget : public Gui::DockWindow Q_OBJECT public: - TreeDockWidget(Gui::Document* pcDocument,QWidget *parent=nullptr); + explicit TreeDockWidget(Gui::Document* pcDocument,QWidget *parent=nullptr); ~TreeDockWidget() override; }; @@ -482,7 +482,7 @@ public: class TreeWidgetEditDelegate: public QStyledItemDelegate { Q_OBJECT public: - TreeWidgetEditDelegate(QObject* parent=nullptr); + explicit TreeWidgetEditDelegate(QObject* parent=nullptr); QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &index) const override; }; diff --git a/src/Gui/UiLoader.h b/src/Gui/UiLoader.h index 03f386eaff..5f8ae0e6cc 100644 --- a/src/Gui/UiLoader.h +++ b/src/Gui/UiLoader.h @@ -107,7 +107,7 @@ private: class UiLoader : public QUiLoader { public: - UiLoader(QObject* parent=nullptr); + explicit UiLoader(QObject* parent=nullptr); ~UiLoader() override; /** diff --git a/src/Gui/Utilities.cpp b/src/Gui/Utilities.cpp index d3cb77af7b..d9abd84f8d 100644 --- a/src/Gui/Utilities.cpp +++ b/src/Gui/Utilities.cpp @@ -133,7 +133,7 @@ std::vector Tessellator::tessellate() const class ItemViewSelection::MatchName { public: - MatchName(const QString& n) : name(n) + explicit MatchName(const QString& n) : name(n) {} bool operator() (const App::DocumentObject* obj) { return name == QLatin1String(obj->getNameInDocument()); diff --git a/src/Gui/Utilities.h b/src/Gui/Utilities.h index 7e322c1610..0787a0bee7 100644 --- a/src/Gui/Utilities.h +++ b/src/Gui/Utilities.h @@ -43,7 +43,7 @@ template <> struct vec_traits { typedef SbVec3f vec_type; typedef float float_type; - vec_traits(const vec_type& v) : v(v){} + explicit vec_traits(const vec_type& v) : v(v){} inline std::tuple get() const { return std::make_tuple(v[0], v[1], v[2]); } @@ -56,7 +56,7 @@ template <> struct vec_traits { typedef SbVec3d vec_type; typedef double float_type; - vec_traits(const vec_type& v) : v(v){} + explicit vec_traits(const vec_type& v) : v(v){} inline std::tuple get() const { return std::make_tuple(v[0], v[1], v[2]); } @@ -69,7 +69,7 @@ template <> struct vec_traits { typedef SbRotation vec_type; typedef float float_type; - vec_traits(const vec_type& v) : v(v){} + explicit vec_traits(const vec_type& v) : v(v){} inline std::tuple get() const { float_type q1,q2,q3,q4; v.getValue(q1,q2,q3,q4); @@ -84,7 +84,7 @@ template <> struct vec_traits { typedef SbColor vec_type; typedef float float_type; - vec_traits(const vec_type& v) : v(v){} + explicit vec_traits(const vec_type& v) : v(v){} inline std::tuple get() const { return std::make_tuple(v[0], v[1], v[2]); } @@ -97,7 +97,7 @@ template <> struct vec_traits { typedef App::Color vec_type; typedef float float_type; - vec_traits(const vec_type& v) : v(v){} + explicit vec_traits(const vec_type& v) : v(v){} inline std::tuple get() const { return std::make_tuple(v.r, v.g, v.b); } @@ -114,7 +114,7 @@ namespace Gui { class GuiExport ViewVolumeProjection : public Base::ViewProjMethod { public: - ViewVolumeProjection (const SbViewVolume &vv); + explicit ViewVolumeProjection (const SbViewVolume &vv); ~ViewVolumeProjection() override{} Base::Vector3f operator()(const Base::Vector3f &rclPt) const override; @@ -133,7 +133,7 @@ protected: class GuiExport Tessellator { public: - Tessellator(const std::vector&); + explicit Tessellator(const std::vector&); std::vector tessellate() const; private: @@ -146,7 +146,7 @@ private: class GuiExport ItemViewSelection { public: - ItemViewSelection(QAbstractItemView* view); + explicit ItemViewSelection(QAbstractItemView* view); void applyFrom(const std::vector objs); private: diff --git a/src/Gui/VectorListEditor.h b/src/Gui/VectorListEditor.h index 16bbacfd81..875bc47ef1 100644 --- a/src/Gui/VectorListEditor.h +++ b/src/Gui/VectorListEditor.h @@ -39,7 +39,7 @@ class VectorTableModel : public QAbstractTableModel Q_OBJECT public: - VectorTableModel(int decimals, QObject *parent = nullptr); + explicit VectorTableModel(int decimals, QObject *parent = nullptr); QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; int columnCount(const QModelIndex &parent = QModelIndex()) const override; @@ -63,7 +63,7 @@ class VectorTableDelegate : public QItemDelegate Q_OBJECT public: - VectorTableDelegate(int decimals, QObject *parent = nullptr); + explicit VectorTableDelegate(int decimals, QObject *parent = nullptr); QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override; @@ -85,7 +85,7 @@ class VectorListEditor : public QDialog Q_OBJECT public: - VectorListEditor(int decimals, QWidget* parent = nullptr); + explicit VectorListEditor(int decimals, QWidget* parent = nullptr); ~VectorListEditor() override; void setValues(const QList&); diff --git a/src/Gui/View3DInventor.h b/src/Gui/View3DInventor.h index ce755cf464..1e9fed65b3 100644 --- a/src/Gui/View3DInventor.h +++ b/src/Gui/View3DInventor.h @@ -45,7 +45,7 @@ class GuiExport GLOverlayWidget : public QWidget Q_OBJECT public: - GLOverlayWidget(QWidget* parent=nullptr) : QWidget(parent) + explicit GLOverlayWidget(QWidget* parent=nullptr) : QWidget(parent) {} ~GLOverlayWidget() override {} diff --git a/src/Gui/View3DInventorViewer.h b/src/Gui/View3DInventorViewer.h index f9f9c33251..efa4ef281c 100644 --- a/src/Gui/View3DInventorViewer.h +++ b/src/Gui/View3DInventorViewer.h @@ -131,7 +131,7 @@ public: }; //@} - View3DInventorViewer (QWidget *parent, const QtGLWidget* sharewidget = nullptr); + explicit View3DInventorViewer (QWidget *parent, const QtGLWidget* sharewidget = nullptr); View3DInventorViewer (const QtGLFormat& format, QWidget *parent, const QtGLWidget* sharewidget = nullptr); ~View3DInventorViewer() override; diff --git a/src/Gui/View3DPy.h b/src/Gui/View3DPy.h index 7d1bd2b091..11ea92f5e7 100644 --- a/src/Gui/View3DPy.h +++ b/src/Gui/View3DPy.h @@ -59,7 +59,7 @@ public: using BaseType = Py::PythonExtension; static void init_type(); // announce properties and methods - View3DInventorPy(View3DInventor *vi); + explicit View3DInventorPy(View3DInventor *vi); ~View3DInventorPy() override; View3DInventor* getView3DIventorPtr(); diff --git a/src/Gui/View3DViewerPy.h b/src/Gui/View3DViewerPy.h index 2b63855218..0f2e275c1a 100644 --- a/src/Gui/View3DViewerPy.h +++ b/src/Gui/View3DViewerPy.h @@ -44,7 +44,7 @@ class View3DInventorViewerPy : public Py::PythonExtensionget(); - } + }//explicit bombs }; /** Helper function to deal with bug in SoNode::removeAllChildren() diff --git a/src/Gui/ViewProviderMeasureDistance.h b/src/Gui/ViewProviderMeasureDistance.h index ac94efe4cf..73b015876f 100644 --- a/src/Gui/ViewProviderMeasureDistance.h +++ b/src/Gui/ViewProviderMeasureDistance.h @@ -44,7 +44,7 @@ class ViewProviderPointMarker; class PointMarker : public QObject { public: - PointMarker(View3DInventorViewer* view); + explicit PointMarker(View3DInventorViewer* view); ~PointMarker() override; void addPoint(const SbVec3f&); diff --git a/src/Gui/propertyeditor/PropertyItem.cpp b/src/Gui/propertyeditor/PropertyItem.cpp index a81a8c13ae..4a3696cab5 100644 --- a/src/Gui/propertyeditor/PropertyItem.cpp +++ b/src/Gui/propertyeditor/PropertyItem.cpp @@ -1349,7 +1349,7 @@ class VectorLineEdit : public Gui::ExpLineEdit { int decimals; public: - VectorLineEdit (int decimals, QWidget * parent=nullptr, bool expressionOnly=false) + explicit VectorLineEdit (int decimals, QWidget * parent=nullptr, bool expressionOnly=false) : Gui::ExpLineEdit(parent, expressionOnly) , decimals(decimals) { @@ -2856,7 +2856,7 @@ struct EnumItem { QString text; QString fullText; std::shared_ptr children; - EnumItem(const QString &t = QString(), const QString &f = QString()) + explicit EnumItem(const QString &t = QString(), const QString &f = QString()) :text(t), fullText(f) {} void populate(QMenu *menu); diff --git a/src/Gui/propertyeditor/PropertyItem.h b/src/Gui/propertyeditor/PropertyItem.h index bde6df92ea..0f2da7cfbe 100644 --- a/src/Gui/propertyeditor/PropertyItem.h +++ b/src/Gui/propertyeditor/PropertyItem.h @@ -105,7 +105,7 @@ template class PropertyItemProducer : public Base::AbstractProducer { public: - PropertyItemProducer(const char* className) { + explicit PropertyItemProducer(const char* className) { PropertyItemFactory::instance().AddProducer(className, this); } ~PropertyItemProducer() override { @@ -499,7 +499,7 @@ class PropertyEditorWidget : public QWidget Q_OBJECT public: - PropertyEditorWidget (QWidget * parent = nullptr); + explicit PropertyEditorWidget (QWidget * parent = nullptr); ~PropertyEditorWidget() override; QVariant value() const; @@ -526,7 +526,7 @@ class VectorListWidget : public PropertyEditorWidget Q_OBJECT public: - VectorListWidget (int decimals, QWidget * parent = nullptr); + explicit VectorListWidget (int decimals, QWidget * parent = nullptr); protected: void showValue(const QVariant& data) override; @@ -762,7 +762,7 @@ class PlacementEditor : public Gui::LabelButton Q_OBJECT public: - PlacementEditor(const QString& name, QWidget * parent = nullptr); + explicit PlacementEditor(const QString& name, QWidget * parent = nullptr); ~PlacementEditor() override; private Q_SLOTS: @@ -853,7 +853,7 @@ class PropertyEnumButton : public QPushButton { Q_OBJECT public: - PropertyEnumButton(QWidget *parent = nullptr) + explicit PropertyEnumButton(QWidget *parent = nullptr) :QPushButton(parent) {} @@ -1123,7 +1123,7 @@ class LinkSelection : public QObject Q_OBJECT public: - LinkSelection(const App::SubObjectT &); + explicit LinkSelection(const App::SubObjectT &); ~LinkSelection() override; public Q_SLOTS: diff --git a/src/Gui/propertyeditor/PropertyItemDelegate.h b/src/Gui/propertyeditor/PropertyItemDelegate.h index b464207aa5..f5db047406 100644 --- a/src/Gui/propertyeditor/PropertyItemDelegate.h +++ b/src/Gui/propertyeditor/PropertyItemDelegate.h @@ -36,7 +36,7 @@ class PropertyItemDelegate : public QItemDelegate Q_OBJECT public: - PropertyItemDelegate(QObject* parent); + explicit PropertyItemDelegate(QObject* parent); ~PropertyItemDelegate() override; void paint(QPainter *painter, const QStyleOptionViewItem &opt, const QModelIndex &index) const override;