diff --git a/src/Gui/WorkbenchSelector.cpp b/src/Gui/WorkbenchSelector.cpp index c2ded0ec6b..a96a530702 100644 --- a/src/Gui/WorkbenchSelector.cpp +++ b/src/Gui/WorkbenchSelector.cpp @@ -1,22 +1,21 @@ /*************************************************************************** * Copyright (c) 2024 Pierre-Louis Boyer * * * - * This file is part of the FreeCAD CAx development system. * + * This file is part of FreeCAD. * * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 of the License, or (at your option) any later version. * + * FreeCAD is free software: you can redistribute it and/or modify it * + * under the terms of the GNU Lesser General Public License as * + * published by the Free Software Foundation, either version 2.1 of the * + * License, or (at your option) any later version. * * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Library General Public License for more details. * + * FreeCAD is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Library General Public * - * License along with this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * + * You should have received a copy of the GNU Lesser General Public * + * License along with FreeCAD. If not, see * + * . * * * ***************************************************************************/ @@ -343,7 +342,7 @@ int WorkbenchTabWidget::addWorkbenchTab(QAction* action, int tabIndex) if (icon.isNull() || itemStyle == WorkbenchItemStyle::TextOnly) { tabBar->insertTab(tabIndex, action->text()); } - else if (itemStyle == IconOnly) { + else if (itemStyle == WorkbenchItemStyle::IconOnly) { tabBar->insertTab(tabIndex, icon, {}); // empty string to ensure only icon is displayed } else { diff --git a/src/Gui/WorkbenchSelector.h b/src/Gui/WorkbenchSelector.h index 2ae36cfd5b..c949ee5b50 100644 --- a/src/Gui/WorkbenchSelector.h +++ b/src/Gui/WorkbenchSelector.h @@ -1,22 +1,21 @@ /*************************************************************************** * Copyright (c) 2024 Pierre-Louis Boyer * * * - * This file is part of the FreeCAD CAx development system. * + * This file is part of FreeCAD. * * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Library General Public * - * License as published by the Free Software Foundation; either * - * version 2 of the License, or (at your option) any later version. * + * FreeCAD is free software: you can redistribute it and/or modify it * + * under the terms of the GNU Lesser General Public License as * + * published by the Free Software Foundation, either version 2.1 of the * + * License, or (at your option) any later version. * * * - * This library is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Library General Public License for more details. * + * FreeCAD is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * * * - * You should have received a copy of the GNU Library General Public * - * License along with this library; see the file COPYING.LIB. If not, * - * write to the Free Software Foundation, Inc., 59 Temple Place, * - * Suite 330, Boston, MA 02111-1307, USA * + * You should have received a copy of the GNU Lesser General Public * + * License along with FreeCAD. If not, see * + * . * * * ***************************************************************************/ @@ -39,7 +38,7 @@ namespace Gui { class WorkbenchGroup; -enum WorkbenchItemStyle { +enum class WorkbenchItemStyle { IconAndText = 0, IconOnly = 1, TextOnly = 2 @@ -47,12 +46,16 @@ enum WorkbenchItemStyle { class GuiExport WorkbenchComboBox : public QComboBox { - Q_OBJECT + Q_OBJECT // NOLINT public: explicit WorkbenchComboBox(WorkbenchGroup* aGroup, QWidget* parent = nullptr); + ~WorkbenchComboBox() override = default; + WorkbenchComboBox(WorkbenchComboBox &&rhs) = delete; void showPopup() override; + WorkbenchComboBox operator=(WorkbenchComboBox &&rhs) = delete; + public Q_SLOTS: void refreshList(QList); @@ -63,7 +66,7 @@ private: class GuiExport WorkbenchTabWidget : public QWidget { - Q_OBJECT + Q_OBJECT // NOLINT Q_PROPERTY(Qt::LayoutDirection direction READ direction WRITE setDirection NOTIFY directionChanged) class WbTabBar : public QTabBar { @@ -73,7 +76,7 @@ class GuiExport WorkbenchTabWidget : public QWidget QSize tabSizeHint(int index) const override { auto sizeFromParent = QTabBar::tabSizeHint(index); - if (itemStyle() != IconOnly) { + if (itemStyle() != WorkbenchItemStyle::IconOnly) { return sizeFromParent; } @@ -126,14 +129,15 @@ class GuiExport WorkbenchTabWidget : public QWidget } private: - WorkbenchItemStyle _itemStyle; + WorkbenchItemStyle _itemStyle{WorkbenchItemStyle::IconAndText}; static const char* workbenchItemStyleToString(WorkbenchItemStyle style) { switch (style) { - case IconAndText: return "icon-and-text"; - case IconOnly: return "icon-only"; - case TextOnly: return "text-only"; + case WorkbenchItemStyle::IconAndText: return "icon-and-text"; + case WorkbenchItemStyle::IconOnly: return "icon-only"; + case WorkbenchItemStyle::TextOnly: return "text-only"; + default: return "WorkbenchItemStyle-internal-error"; } } };