diff --git a/src/Gui/ToolBarManager.cpp b/src/Gui/ToolBarManager.cpp index 49adfca233..04876e39b3 100644 --- a/src/Gui/ToolBarManager.cpp +++ b/src/Gui/ToolBarManager.cpp @@ -189,7 +189,8 @@ public: void addWidget(QWidget *widget) { - if (_layout->indexOf(widget) > 0) { + // if widget already exist don't do anything + if (_layout->indexOf(widget) >= 0) { return; } @@ -311,7 +312,7 @@ public: widget->setVisible(visible); } } - }; + } private: QHBoxLayout *_layout; diff --git a/src/Gui/ToolBarManager.h b/src/Gui/ToolBarManager.h index f5ee13cc6f..5f26693911 100644 --- a/src/Gui/ToolBarManager.h +++ b/src/Gui/ToolBarManager.h @@ -43,7 +43,7 @@ namespace Gui { // Qt treats area as Flag so in theory toolbar could be in multiple areas at once. // We don't do that here so simple enum should suffice. -enum GuiExport ToolBarArea { +enum class ToolBarArea { NoToolBarArea, LeftToolBarArea, RightToolBarArea,