diff --git a/src/Gui/Action.h b/src/Gui/Action.h index 0a251c4f31..1693c1c1f5 100644 --- a/src/Gui/Action.h +++ b/src/Gui/Action.h @@ -46,7 +46,7 @@ class GuiExport Action : public QObject Q_OBJECT public: - Action (Command* pcCmd, QObject * parent = nullptr); + explicit Action (Command* pcCmd, QObject * parent = nullptr); /// Action takes ownership of the 'action' object. Action (Command* pcCmd, QAction* action, QObject * parent); virtual ~Action(); @@ -128,7 +128,7 @@ class GuiExport ActionGroup : public Action Q_OBJECT public: - ActionGroup (Command* pcCmd, QObject * parent = nullptr); + explicit ActionGroup (Command* pcCmd, QObject * parent = nullptr); virtual ~ActionGroup(); void addTo (QWidget * w); @@ -168,7 +168,7 @@ class GuiExport WorkbenchComboBox : public QComboBox Q_OBJECT public: - WorkbenchComboBox(WorkbenchGroup* wb, QWidget* parent=nullptr); + explicit WorkbenchComboBox(WorkbenchGroup* wb, QWidget* parent=nullptr); virtual ~WorkbenchComboBox(); void showPopup(); @@ -227,7 +227,7 @@ class GuiExport RecentFilesAction : public ActionGroup Q_OBJECT public: - RecentFilesAction (Command* pcCmd, QObject * parent = nullptr); + explicit RecentFilesAction (Command* pcCmd, QObject * parent = nullptr); virtual ~RecentFilesAction(); void appendFile(const QString&); @@ -260,7 +260,7 @@ class GuiExport RecentMacrosAction : public ActionGroup Q_OBJECT public: - RecentMacrosAction (Command* pcCmd, QObject * parent = nullptr); + explicit RecentMacrosAction (Command* pcCmd, QObject * parent = nullptr); virtual ~RecentMacrosAction(); void appendFile(const QString&); @@ -293,7 +293,7 @@ class GuiExport UndoAction : public Action Q_OBJECT public: - UndoAction (Command* pcCmd,QObject * parent = nullptr); + explicit UndoAction (Command* pcCmd,QObject * parent = nullptr); ~UndoAction(); void addTo (QWidget * w); void setEnabled(bool); @@ -318,7 +318,7 @@ class GuiExport RedoAction : public Action Q_OBJECT public: - RedoAction (Command* pcCmd,QObject * parent = nullptr); + explicit RedoAction (Command* pcCmd,QObject * parent = nullptr); ~RedoAction(); void addTo ( QWidget * w ); void setEnabled(bool); @@ -342,7 +342,7 @@ class GuiExport DockWidgetAction : public Action Q_OBJECT public: - DockWidgetAction (Command* pcCmd, QObject * parent = nullptr); + explicit DockWidgetAction (Command* pcCmd, QObject * parent = nullptr); virtual ~DockWidgetAction(); void addTo (QWidget * w); @@ -361,7 +361,7 @@ class GuiExport ToolBarAction : public Action Q_OBJECT public: - ToolBarAction (Command* pcCmd, QObject * parent = nullptr); + explicit ToolBarAction (Command* pcCmd, QObject * parent = nullptr); virtual ~ToolBarAction(); void addTo (QWidget * w); @@ -379,7 +379,7 @@ class GuiExport WindowAction : public ActionGroup Q_OBJECT public: - WindowAction (Command* pcCmd, QObject * parent = nullptr); + explicit WindowAction (Command* pcCmd, QObject * parent = nullptr); virtual ~WindowAction(); void addTo (QWidget * w); diff --git a/src/Gui/CMakeLists.txt b/src/Gui/CMakeLists.txt index 053b701e8c..b442d9c3cd 100644 --- a/src/Gui/CMakeLists.txt +++ b/src/Gui/CMakeLists.txt @@ -862,8 +862,8 @@ SET(Quarter_MOC_HDR qt_wrap_cpp(Quarter_MOC_SRCS ${Quarter_MOC_HDR}) -SET(Quarter_SRCS - ${Quarter_CPP_SRC} +SET(Quarter_SRCS + ${Quarter_CPP_SRC} ${Quarter_H_SRC} ${Quarter_MOC_SRCS} ) @@ -1128,7 +1128,7 @@ SET(FreeCADGui_CPP_SRCS ManualAlignment.cpp TransactionObject.cpp ) -SET(FreeCADGui_SRCS +SET(FreeCADGui_SRCS Application.h AutoSaver.h BitmapFactory.h diff --git a/src/Gui/CommandCompleter.cpp b/src/Gui/CommandCompleter.cpp index 7ec5844e7a..212744a8b0 100644 --- a/src/Gui/CommandCompleter.cpp +++ b/src/Gui/CommandCompleter.cpp @@ -55,7 +55,7 @@ class CommandModel : public QAbstractItemModel int revision = 0; public: - CommandModel(QObject* parent) + explicit CommandModel(QObject* parent) : QAbstractItemModel(parent) { update(); diff --git a/src/Gui/CommandCompleter.h b/src/Gui/CommandCompleter.h index 18a3f35e1f..1f578e1909 100644 --- a/src/Gui/CommandCompleter.h +++ b/src/Gui/CommandCompleter.h @@ -41,7 +41,7 @@ class GuiExport CommandCompleter : public QCompleter { Q_OBJECT public: - CommandCompleter(QLineEdit *edit, QObject *parent = nullptr); + explicit CommandCompleter(QLineEdit *edit, QObject *parent = nullptr); Q_SIGNALS: /// Triggered when a command is selected in the completer diff --git a/src/Gui/CommandPyImp.cpp b/src/Gui/CommandPyImp.cpp index 50005c268f..f563cb287d 100644 --- a/src/Gui/CommandPyImp.cpp +++ b/src/Gui/CommandPyImp.cpp @@ -306,7 +306,7 @@ PyObject* CommandPy::createCustomCommand(PyObject* args, PyObject* kw) auto macro = new MacroCommand(name.c_str(), false); commandManager.addCommand(macro); - macro->setScriptName(macroFile); + macro->setScriptName(macroFile); if (menuTxt) macro->setMenuText(menuTxt); @@ -338,8 +338,8 @@ PyObject* CommandPy::removeCustomCommand(PyObject* args) CommandManager& commandManager = Application::Instance->commandManager(); std::vector macros = commandManager.getGroupCommands("Macros"); - auto action = std::find_if(macros.begin(), macros.end(), [actionName](const Command* c) { - return std::string(c->getName()) == std::string(actionName); + auto action = std::find_if(macros.begin(), macros.end(), [actionName](const Command* c) { + return std::string(c->getName()) == std::string(actionName); }); if (action != macros.end()) { diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index ca2c9737af..533a1b4373 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -2599,7 +2599,7 @@ void StdViewBoxZoom::activated(int iMsg) View3DInventorViewer* viewer = view->getViewer(); if (!viewer->isSelecting()) { SelectionCallbackHandler::Create(viewer, View3DInventorViewer::BoxZoom, QCursor(QPixmap(cursor_box_zoom), 7, 7)); - } + } } } diff --git a/src/Gui/DlgKeyboard.ui b/src/Gui/DlgKeyboard.ui index 0e8b9f0e27..5e2d77ca5e 100644 --- a/src/Gui/DlgKeyboard.ui +++ b/src/Gui/DlgKeyboard.ui @@ -182,10 +182,10 @@ be treated as shorctcut key sequence 'F, F'. This list shows commands having the same shortcut in the priority from high to low. If more than one command with the same shortcut are active at the -same time. The one with the highest prioirty will be triggered. +same time. The one with the highest priority will be triggered. - Shorcut priority list: + Shortcut priority list: diff --git a/src/Gui/ShortcutManager.cpp b/src/Gui/ShortcutManager.cpp index e56ff25b01..62d2034c99 100644 --- a/src/Gui/ShortcutManager.cpp +++ b/src/Gui/ShortcutManager.cpp @@ -322,10 +322,10 @@ bool ShortcutManager::eventFilter(QObject *o, QEvent *ev) if (it->key.shortcut == action->shortcut() && it->key.name == name) break; QKeySequence oldShortcut = it->key.shortcut; - index.replace(it, {action, name}); + index.replace(it, ActionData{action, name}); actionShortcutChanged(action, oldShortcut); } else { - index.insert({action, name}); + index.insert(ActionData{action, name}); actionShortcutChanged(action, QKeySequence()); } } diff --git a/src/Gui/ShortcutManager.h b/src/Gui/ShortcutManager.h index bca1f73c76..2af637b6ea 100644 --- a/src/Gui/ShortcutManager.h +++ b/src/Gui/ShortcutManager.h @@ -20,8 +20,8 @@ * * ****************************************************************************/ -#ifndef GUI_SHORTCUT_MANAGER_H -#define GUI_SHORTCUT_MANAGER_H +#ifndef GUI_SHORTCUT_MANAGER_H +#define GUI_SHORTCUT_MANAGER_H #include @@ -108,7 +108,7 @@ private: struct ActionKey { QKeySequence shortcut; QByteArray name; - ActionKey(const QKeySequence &shortcut, const char *name = "") + explicit ActionKey(const QKeySequence &shortcut, const char *name = "") : shortcut(shortcut) , name(name) {} @@ -126,7 +126,7 @@ private: intptr_t pointer; QPointer action; - ActionData(QAction *action, const char *name = "") + explicit ActionData(QAction *action, const char *name = "") : key(action->shortcut(), name) , pointer(reinterpret_cast(action)) , action(action) diff --git a/src/Gui/ToolBarManager.h b/src/Gui/ToolBarManager.h index d2486e0162..778841dd01 100644 --- a/src/Gui/ToolBarManager.h +++ b/src/Gui/ToolBarManager.h @@ -26,6 +26,7 @@ #include #include +#include class QAction; class QToolBar; @@ -41,7 +42,7 @@ public: }; ToolBarItem(); - ToolBarItem(ToolBarItem* item, HideStyle forceHide = HideStyle::VISIBLE); + explicit ToolBarItem(ToolBarItem* item, HideStyle forceHide = HideStyle::VISIBLE); ~ToolBarItem(); void setCommand(const std::string&); diff --git a/src/Gui/Widgets.cpp b/src/Gui/Widgets.cpp index c5940191bb..1b7975afd5 100644 --- a/src/Gui/Widgets.cpp +++ b/src/Gui/Widgets.cpp @@ -1255,7 +1255,7 @@ void StatusWidget::hideEvent(QHideEvent*) class LineNumberArea : public QWidget { public: - LineNumberArea(PropertyListEditor *editor) : QWidget(editor) { + explicit LineNumberArea(PropertyListEditor *editor) : QWidget(editor) { codeEditor = editor; }