Gui: Fix ToolBarManager review remarks

This commit is contained in:
Kacper Donat
2024-05-14 19:53:00 +02:00
committed by Chris Hennes
parent 0c53340746
commit f040c0820c
2 changed files with 4 additions and 3 deletions

View File

@@ -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;

View File

@@ -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,